From e02fe5c7b57040c6f0298b17a21c880804ddbf59 Mon Sep 17 00:00:00 2001 From: Federico Terzi Date: Sun, 22 Sep 2019 19:02:02 +0200 Subject: [PATCH] Add documentation page --- _config.yml | 5 +-- _data/docs.yml | 6 ++++ _layouts/default.html | 1 + _layouts/docs.html | 78 +++++++++++++++++++++++++++++++++++++++++++ _sass/_docs.scss | 47 ++++++++++++++++++++++++++ _sass/main.scss | 3 +- assets/js/script.js | 16 +++++++++ docs.html | 22 +++++++++++- docs/basic-usage.md | 7 ++++ install/linux.md | 6 ++-- install/mac.md | 6 ++-- install/win.md | 13 +++++--- 12 files changed, 193 insertions(+), 17 deletions(-) create mode 100644 _data/docs.yml create mode 100644 _layouts/docs.html create mode 100644 _sass/_docs.scss create mode 100644 assets/js/script.js create mode 100644 docs/basic-usage.md diff --git a/_config.yml b/_config.yml index 144d89f..e3c2578 100644 --- a/_config.yml +++ b/_config.yml @@ -9,9 +9,6 @@ github_username: federico-terzi permalink: /blog/:title/ highlighter: rouge -collections: - portfolios: - # Build settings markdown: kramdown theme: minima @@ -19,7 +16,7 @@ plugins: - jekyll-feed - jekyll-sitemap - jekyll-seo-tag - + social: name: Federico Terzi links: diff --git a/_data/docs.yml b/_data/docs.yml new file mode 100644 index 0000000..f0a3b9e --- /dev/null +++ b/_data/docs.yml @@ -0,0 +1,6 @@ +- name: Installation + link: /install/ + desc: This section will cover the installation process on Windows, macOS and Linux. +- name: Basic Usage + link: /docs/basic-usage/ + desc: In this section we will cover the basics of espanso to get you started immediately. \ No newline at end of file diff --git a/_layouts/default.html b/_layouts/default.html index caeea12..668ca00 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -66,6 +66,7 @@ If you want to see more interesting projects, visit my website: https://federico + {% if page.showParticles %} diff --git a/_layouts/docs.html b/_layouts/docs.html new file mode 100644 index 0000000..087ba40 --- /dev/null +++ b/_layouts/docs.html @@ -0,0 +1,78 @@ +--- +layout: default +hideTitle: true +--- +
+
+
+
+

{{page.title}}

+
+
+
+
+ +
+
+ {{ content }} +
+ +
diff --git a/_sass/_docs.scss b/_sass/_docs.scss new file mode 100644 index 0000000..c7fac2f --- /dev/null +++ b/_sass/_docs.scss @@ -0,0 +1,47 @@ +.docs { + text-align: justify; + + .index { + position: -webkit-sticky; + position: sticky; + top: 20px; + + li { + margin-bottom: 5px; + } + a { + color: $blackColor; + border-right-style: solid; + } + + .active { + a { + color: $mainColor; + } + } + } + + h3, h4, h5 { + @media screen and (max-width: $screen-phone) { + text-align: center; + } + } + + .card-body { + h3 { + margin: 0 0 15px 0; + } + } +} + +.doc-col { + padding: 10px; + + .card-link { + color: $blackColor; + } + + .card:hover { + border-color: $mainColor; + } +} \ No newline at end of file diff --git a/_sass/main.scss b/_sass/main.scss index b017b81..75b139c 100644 --- a/_sass/main.scss +++ b/_sass/main.scss @@ -6,4 +6,5 @@ @import '_syntax'; @import '_install'; @import '_donate'; -@import '_footer'; \ No newline at end of file +@import '_footer'; +@import '_docs'; \ No newline at end of file diff --git a/assets/js/script.js b/assets/js/script.js new file mode 100644 index 0000000..da2ee67 --- /dev/null +++ b/assets/js/script.js @@ -0,0 +1,16 @@ +function isVisible(element) { + var coordinates = element.getBoundingClientRect(); + + if ( + coordinates.right > window.innerWidth || + coordinates.bottom > window.innerHeight + ) { + return false; + } + + if (coordinates.top < 0 || coordinates.left < 0) { + return false; + } + + return true; +} \ No newline at end of file diff --git a/docs.html b/docs.html index 5e1feff..bd88f19 100644 --- a/docs.html +++ b/docs.html @@ -3,4 +3,24 @@ title: Documentation layout: default showParticles: True --- -TODO \ No newline at end of file +{% for item in site.data.docs %} + {% assign remainder = forloop.index0 | modulo: 4 %} + {% if remainder == 0 %} + {% if forloop.index0 != 0 %} + + {% endif %} + +
+ {% endif %} + +{% endfor %} +
\ No newline at end of file diff --git a/docs/basic-usage.md b/docs/basic-usage.md new file mode 100644 index 0000000..5ff5cef --- /dev/null +++ b/docs/basic-usage.md @@ -0,0 +1,7 @@ +--- +title: Basic Usage +layout: docs +--- +In this section we will cover the basics of espanso to get you started immediately. + +TODO \ No newline at end of file diff --git a/install/linux.md b/install/linux.md index 5a767d5..d09da49 100644 --- a/install/linux.md +++ b/install/linux.md @@ -1,6 +1,6 @@ --- title: Install on Linux -layout: default +layout: docs --- The linux installation depends on the distro you are using. Espanso has been tested in the following distros, but you shouldn't @@ -9,7 +9,7 @@ have many problems making it work on others. * [Ubuntu/Debian](#installing-on-ubuntu--debian) * [Manjaro/Arch](#installing-on-manjaro--arch) -#### Installing on Ubuntu / Debian +### Installing on Ubuntu / Debian Espanso depends upon the `X11 Record Extension`, the `xdo library` and the `xclip` command, so you will need to install those first with the following commands: @@ -38,7 +38,7 @@ espanso start If you now type `:espanso` in any text field, you should see "Hi there!" appear! -#### Installing on Manjaro / Arch +### Installing on Manjaro / Arch Espanso depends upon the `X11 Record Extension`, the `xdo library` and the `xclip` command, so you will need to install those first with the following commands: diff --git a/install/mac.md b/install/mac.md index 3b6f2d0..79ecdcd 100644 --- a/install/mac.md +++ b/install/mac.md @@ -1,11 +1,11 @@ --- title: Install on macOS -layout: default +layout: docs --- The easiest way to install espanso on macOS is by using the [Homebrew](https://brew.sh/) package manager, but you can also do it manually. -#### Using Homebrew +### Using Homebrew The first thing to do is to add the official espanso *tap* to Homebrew with the following command: @@ -28,7 +28,7 @@ espanso --version At this point, you have to [Enable Accessibility](#enabling-accessibility) to use espanso. -#### Enabling Accessibility +### Enabling Accessibility Because espanso uses the macOS [Accessibility API](https://developer.apple.com/library/archive/documentation/Accessibility/Conceptual/AccessibilityMacOSX/) to work, you need to authorize it using the following procedure: diff --git a/install/win.md b/install/win.md index ca4bfdd..bbc5101 100644 --- a/install/win.md +++ b/install/win.md @@ -1,15 +1,18 @@ --- title: Install on Windows -layout: default +layout: docs --- -The installation on Windows is straightforward, download the installer by -clicking on the button below and follow the instructions. +The easiest way to install espanso on Windows is by using the official installer. -
+### Using the Installer + +Download the installer by clicking on the button below and follow the instructions. + +
Download the Installer
-#### Problems you may experience +### Problems you may experience Because espanso is not digitally signed, you may experience a warning from Windows Smartscreen. In this case, just click on "More info" (1) and then