diff --git a/.github/docs-badge.svg b/.github/docs-badge.svg new file mode 100644 index 0000000..1e6f6c8 --- /dev/null +++ b/.github/docs-badge.svg @@ -0,0 +1 @@ +documentationdocumentation \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 389f179..5f1ce0e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - platform: [windows-2022, macos-12] + platform: [windows-2022, macos-12, ubuntu-22.04] go-version: [1.18] node-version: [16] @@ -45,6 +45,11 @@ jobs: - name: Build Rolens run: wails build + upload-artifact: + runs-on: ubuntu-latest + needs: build + + steps: - name: Upload binary uses: actions/upload-artifact@v2 with: diff --git a/INSTALL.md b/INSTALL.md new file mode 100644 index 0000000..ef84a6c --- /dev/null +++ b/INSTALL.md @@ -0,0 +1,42 @@ +# Installation procedure + +## System requirements + +Rolens can run on the following operating systems: + +* Windows 10/11 amd64/arm64 +* Linux amd64/arm64 +* macOS 10.13+ amd64 (Intel) +* macOS 11.0+ arm64 (Apple Silicon) + +## Pre-compiled binaries + +You can obtain a pre-compiled Rolens binary for macOS or installer for Windows from the [release page](https://github.com/garraflavatra/rolens/releases/latest). + +## From source + +Rolens is open-source software, which means that you can compile it from source on your own machine by cloning [the repository](https://github.com/garraflavatra/rolens). + +### Prerequisites + +Rolens is written in Go, so you should download the Go compiler from [the download page](https://go.dev/dl/). The minimum version required is 1.18. You can confirm whether it's installed correctly by running `go version` and checking that it outputs something similar to `go1.18.2`. + +Furthermore, you need to have [Wails ^3.1](https://wails.io/docs/gettingstarted/installation) installed: `go install github.com/wailsapp/wails/v2/cmd/wails@latest`. Wails may have platform-specific dependencies; you can consult `wails doctor` to find out what dependencies Wails needs and how to install them. + +In order to compile the frontend, [Node.js](https://nodejs.org/en/download) ^16.0 and the [npm](https://npmjs.com) package manager ^8.0 (included in Node.js) are required. To confirm the installed versions of those tools, execute `node -v` and `npm -v`. + +### Download source + +To obtain a copy of the source code, do either of the following: + +* Download a tarball or zip archive from the [release page](https://github.com/garraflavatra/rolens/releases/latest). Make sure you download the source archive, and not a pre-compiled binary. +* Or clone [the Git repository](https://github.com/garraflavatra/rolens): `git clone https://github.com/garraflavatra/rolens.git`. + +### Compile + +`cd` into the root directory of the source code and run either: + +* `wails build` to generate an executable for your platform. +* `wails build -nsis` to generate an [NSIS installer](https://nsis.sourceforge.io/Main_Page). This requires that you have NSIS installed on your machine. + +The generated binary will live in `build/bin`. You may want to run the installer (Windows) or move the app to the Applications folder (Mac). diff --git a/README.md b/README.md index e77e9a7..3cc99bd 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Robust, blazing-fast, comprehensive, yet simple [MongoDB](https://www.mongodb.com/) administration tool for Windows, macOS and Linux. -[![CI](https://github.com/garraflavatra/rolens/actions/workflows/ci.yml/badge.svg)](https://github.com/garraflavatra/rolens/actions/workflows/ci.yml) +[![CI](https://github.com/garraflavatra/rolens/actions/workflows/ci.yml/badge.svg)](https://github.com/garraflavatra/rolens/actions/workflows/ci.yml) [![Documentation](./.github/docs-badge.svg)](https://garraflavatra.github.io/rolens) ## Why another MongoDB client? diff --git a/docs/installation.md b/docs/installation.md index 55b2de1..dd6471e 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -3,43 +3,4 @@ title: Installation order: 20 --- -## System requirements - -Rolens can run on the following operating systems: - -* Windows 10/11 amd64/arm64 -* Linux amd64/arm64 -* macOS 10.13+ amd64 (Intel) -* macOS 11.0+ arm64 (Apple Silicon) - -## Pre-compiled binaries - -You can obtain a pre-compiled Rolens binary for macOS or installer for Windows from the [release page](https://github.com/garraflavatra/rolens/releases/latest). - -## From source - -Rolens is open-source software, which means that you can compile it from source on your own machine by cloning [the repository](https://github.com/garraflavatra/rolens). - -### Prerequisites - -Rolens is written in Go, so you should download the Go compiler from [the download page](https://go.dev/dl/). The minimum version required is 1.18. You can confirm whether it's installed correctly by running `go version` and checking that it outputs something similar to `go1.18.2`. - -Furthermore, you need to have [Wails ^3.1](https://wails.io/docs/gettingstarted/installation) installed: `go install github.com/wailsapp/wails/v2/cmd/wails@latest`. - -In order to compile the frontend, [Node.js](https://nodejs.org/en/download) ^16.0 and the [npm](https://npmjs.com) package manager ^8.0 (included in Node.js) are required. To confirm the installed versions of those tools, execute `node -v` and `npm -v`. - -### Download source - -To obtain a copy of the source code, do either of the following: - -* Download a tarball or zip archive from the [release page](https://github.com/garraflavatra/rolens/releases/latest). Make sure you download the source archive, and not a pre-compiled binary. -* Or clone [the Git repository](https://github.com/garraflavatra/rolens): `git clone https://github.com/garraflavatra/rolens.git`. - -### Compile - -`cd` into the root directory of the source code and run either: - -* `wails build` to generate an executable for your platform. -* `wails build -nsis` to generate an [NSIS installer](https://nsis.sourceforge.io/Main_Page). This requires that you have NSIS installed on your machine. - -The generated binary will live in `build/bin`. You may want to run the installer (Windows) or move the app to the Applications folder (Mac). +{% filecontent "../INSTALL.md", 2 %} diff --git a/internal/ui/open_linux.go b/internal/ui/open_linux.go new file mode 100644 index 0000000..7645b9f --- /dev/null +++ b/internal/ui/open_linux.go @@ -0,0 +1,9 @@ +//go:build linux + +package ui + +import "os/exec" + +func reveal(fname string) { + exec.Command("xdg-open", fname).Run() +} diff --git a/website/.eleventy.js b/website/.eleventy.js index 8d7ed22..d3cd2dc 100644 --- a/website/.eleventy.js +++ b/website/.eleventy.js @@ -90,9 +90,10 @@ module.exports = function (eleventyConfig) { }); // Retrieve content of a file - eleventyConfig.addFilter('filecontent', function (fname) { + eleventyConfig.addShortcode('filecontent', function (fname, startLine = 0) { const buf = fs.readFileSync(path.join(indir, fname)); - return buf.toString(); + const str = buf.toString().split('\n').slice(startLine).join('\n'); + return str; }); // Global options