Skip to content

Commit

Permalink
Enable multi-language docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanlesage committed Sep 8, 2019
1 parent 9a418f8 commit 33c431f
Show file tree
Hide file tree
Showing 146 changed files with 2,602 additions and 15 deletions.
31 changes: 22 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,44 @@ As soon as we run a new build, your changes will automatically be included and a

## New Pages and Changes to the Structure

New pages in our documentation will require some structural adjustments, which you need to discuss beforehand. If you have an idea on how to structure the documentation, please discuss your proposal on our [forum](https:/7forum.zettlr.com).
New pages in our documentation will require some structural adjustments, which you need to discuss beforehand. If you have an idea on how to structure the documentation, please discuss your proposal on our [forum](https://forum.zettlr.com).

## The Structure

All source files reside in the `docs` directory. The images reside in the `img` directory within the `docs`-directory. The names of the files should speak for themselves. The `assets`-subdirectory holds additional files that are necessary for building the docs.
These docs are multi-language. Inside the `docs`-subdirectory, you'll find all languages inside ISO-coded directories. Inside these, you will find one `assets`-folder, which contains a symbolic link to the top-level assets's `app.css`-file. The rest of the files are independent and unique for each language.

You can create a `resources` directory on the root level to store additional files that you may need, as the `.gitignore` file will not commit this directory.

## Testing and Building

To locally test how your changes work out, you'll need to install [MkDocs](https://www.mkdocs.org/). MkDocs is a comprehensive library that allows for easy building of whole documentations. Please follow the instructions by the creators of MkDocs on how to set up the software on your computer.

If MkDocs is set up, inside your directory run:
Most of the default commands won't work with our setup, so please use the custom scripts:

```bash
$ mkdocs serve
```
### serve.sh

to start up a local development server which will watch the files as you go. To build the page locally, run:
The `serve.sh`-script serves a specific language for testing. Simply run:

```bash
$ mkdocs build
$ ./scripts/serve.sh en
```

Further commands and options are available at their [homepage](https://www.mkdocs.org/).
and replace "en" with an existing language code to spin up the development server. If you omit this, it will simply spin up the English language server.

### build.sh

The `build.sh`-scripts builds the full documentation. Simply run it. It will scan the `docs`-directory and run the corresponding `.yml`-configuration file located in the `config`-directory.

## Create More Languages

Want to add a language? Perfect, here's how you do it:

1. Copy any of the configuration files in `./config`. Rename it to the corresponding ISO-code (e.g. `es` for Spanish, `fr` for French, and so on).
2. Create a new directory corresponding to the same ISO-code in `./docs`.
3. Inside this directory, create an `assets`-subdirectory and create a symbolic link to the `./assets/app.css`-CSS file. This is important so that changes to the master file are propagated to all languages, keeping it DRY.
4. Head to the `./assets/index.html`-file and add your language to the bottom (simply copy one of the existing list items, the changes necessary should be self-explanatory).
5. Add your documentation and adapt the `./config/<code>.yml`-configuration file as appropriate.
6. Commit via PR.

## License

Expand Down
2 changes: 1 addition & 1 deletion docs/assets/app.css → assets/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* General branding: Let's use the Zettlr green instead of the default blue
*/
section.wy-nav-content-wrap a { color: rgb(28, 178, 126); }
section.wy-nav-content-wrap a { color: black;}/*rgb(28, 178, 126); }*/
nav.wy-nav-top a, nav.my-nav-top a:active { color: white; }
.wy-side-nav-search a, .wy-side-nav-search a:visited { color: white; }

Expand Down
66 changes: 66 additions & 0 deletions assets/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Zettlr Docs</title>
<style>
* {
box-sizing: border-box;
}

html, body {
font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif
}

body {
width: 100%;
height: 100%;
}

.container {
width: 30vw;
margin: 0 auto;
}

.container ul {
list-style-type: none;
margin: 0;
padding: 0;
}

.container ul li a {
text-decoration: none;
display: inline-block;
width: 100%;
text-align: center;
margin: 5px;
padding: 10px;
border: 1px solid #aaaaaa;
border-radius: 5px;
transition: 0.2s all ease;
color: #333;
}

.container ul li a:hover {
background-color: rgba(140, 150, 140, 1);
color: white;
}
</style>
</head>
<body>
<div class="container">
<h1>Zettlr Docs</h1>
<p>
Please select your language.
</p>
<p>
<ul>
<li><a href="/en"><span class="flag">🇬🇧</span> English</a></li>
<li><a href="/de"><span class="flag">🇩🇪</span> Deutsch</a></li>
</ul>
</p>
</div>
</body>
</html>
62 changes: 62 additions & 0 deletions config/de.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
site_name: Zettlr Docs
site_url: https://docs.zettlr.com/de
repo_url: https://github.com/Zettlr/zettlr-docs
site_description: >-
Die Dokumentation für den Markdown-Editor Zettlr enthält alle Informationen
zum erfolgreichen Schreiben.
site_author: Hendrik Erz
copyright: "&copy; 2017-2019 by Zettlr"
docs_dir: ../docs/de
site_dir: ../build/de
edit_uri: edit/master/docs/de
extra_css:
- assets/app.css
nav:
- Willkommen: index.md
- Installation: install.md
- Schnellstart: 5-minutes.md
- Anleitungen:
- Zettlr als Notizapp: guides/guide-notes.md
- Zettlr als Zettelkasten: guides/guide-zettelkasten.md
- Zettlr als IDE: guides/guide-ide.md
- Core:
- Editor: core/editor.md
- Dateiliste: core/file-list.md
- Suchen: core/search.md
- Exportieren: core/export.md
- Tabelleneditor: core/tables.md
- Virtuelle Verzeichnisse: core/virtual-directories.md
- Custom CSS: core/custom-css.md
- Lokalisation: core/localisation.md
- Seitenleiste: core/attachments.md
- Wissenschaftliche Werkzeuge:
- Zitationen: academic/citations.md
- Projekte: academic/projects.md
- Präsentationen: academic/presentations.md
- Pomodoro-Timer: academic/pomodoro.md
- Lesbarkeitsmodus: academic/readability.md
- Zettelkastenmethodologie: academic/zkn-method.md
- Eigene Vorlagen: academic/custom-templates.md
- Referenzen:
- Tastaturkürzel: reference/shortcuts.md
- Markdown-Grundlagen: reference/markdown-basics.md
- Einstellungen: reference/settings.md
- Rechtschreibprüfung: reference/spell-checking.md
- Mach mit!: get-involved.md
- FAQ: faq.md
theme:
name: readthedocs
custom_dir: ../theme_override
highlightjs: True
prev_next_buttons_location: both
hljs_languages:
- javascript
- css
- yaml
- tex
markdown_extensions:
- toc:
permalink: True
plugins:
- search:
lang: de
13 changes: 8 additions & 5 deletions mkdocs.yml → config/en.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
site_name: Zettlr Docs
site_url: https://docs.zettlr.com
site_url: https://docs.zettlr.com/en
repo_url: https://github.com/Zettlr/zettlr-docs
site_description: Our comprehensive documentation provides you with everything you need to know about how to make the most of Zettlr.
site_description: >-
Our comprehensive documentation provides you with everything you need to
know about how to make the most of Zettlr.
site_author: Hendrik Erz
copyright: "&copy; 2017-2019 by Zettlr"
docs_dir: docs
site_dir: build
docs_dir: ../docs/en
site_dir: ../build/en
edit_uri: edit/master/docs/en
extra_css:
- assets/app.css
nav:
Expand Down Expand Up @@ -43,7 +46,7 @@ nav:
- FAQ: faq.md
theme:
name: readthedocs
custom_dir: theme_override
custom_dir: ../theme_override
highlightjs: True
prev_next_buttons_location: both
hljs_languages:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions docs/de/assets/app.css
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
69 changes: 69 additions & 0 deletions docs/en/5-minutes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Zettlr in 5 Minutes

Okay, you have downloaded and installed the app, got a clock set and are ready to roll? Then hit that countdown button and let's go!

## 1. Open directories and files

To open directories or files, simply drag them anywhere over the app's window. They will be opened automatically. You can also hit `Cmd/Ctrl+O` to open the directory select dialog, if that's faster for where you're going.

![open.png](img/open.png)

## 2. Create files and directories

After opening a directory, you need a file. Hit `Cmd/Ctrl+N` to create a new file. Type a file name, hit `Return` and select the editor. Need another directory? `Cmd/Ctrl+Shift+N` will do the job.

![create.png](img/create.png)

> You can not only add Markdown files! If you do not provide an extension, Zettlr will add the extension `.md` for you. But you can also create `.txt`-files and `.tex`-files, you just need to provide that file extension!
## 3. Write!

Writing is up to you, but here's the most important keystrokes to remember:

- `Cmd/Ctrl+I`: Make text \__italic_\_. Works just like in Word.
- `Cmd/Ctrl+B`: Make text \*\***bold**\*\*. Also works just like in Word.
- `Cmd+Alt+R` (macOS) `Ctrl+Alt+F` (Windows/Linux): Create a footnote.
- `Alt/Ctrl+Click` (on a footnote reference): Edit a footnote. Hit `Shift+Enter` to finish editing.
- `Cmd/Ctrl+K`: Insert a link. (`Alt/Ctrl+Click` it to open the link.)
- `Cmd/Ctrl+J`: Enter the distraction-free mode.
- `Cmd/Ctrl+Alt+L`: Toggle the theme between light and dark mode.

![markdown.png](img/markdown.png)

Things without keystrokes, but also important:

- Use `#`-signs to create headings. The number of `#`-symbols equals the level of the heading. Maximum is 6.
- Use `>`-signs to create blockquotes. You can also nest them using multiple greater-than-signs (e.g. `> >`).
- Use `#`-signs _not_ followed by a space to create tags. You can use these tags for searching and navigating.

## 4. What else?

If you use the thin sidebar mode (the default), you will see either the file list or the directory tree. Move the mouse to the top-left corner of the file list and click the arrow to show the directory tree. To toggle between file list and directory tree, you can also hit `Cmd/Ctrl+!`. Choose the extended sidebar mode in the preferences to have both the file list and the directory tree visible at once.

![back.png](img/back.png)

Zettlr is strictly context-based. Unless otherwise specified, new files and directories will be created inside the currently selected directory. File-based operations (renaming or deleting) will by default target the current file. Use the context menu by right-clicking any file or directory to select specific files/directories.

Three simple rules of thumb:

1. The `Alt`(ernative) key triggers alternative actions on the same element.
2. The `Shift` modifier key _shifts_ the target of an action to another element (mostly the directory instead of the file).
3. All crucial actions are located in the toolbar. Left are general actions, middle are file-based actions, and to the right are other actions.

## 5. Nice, I've finished writing. How do I share it?

Three easy steps:

1. Make sure Pandoc and LaTeX (only necessary for PDF) are installed.
2. Click the share button in the toolbar (or hit `Cmd/Ctrl+E`) and select the target format. The aperture reveals the presentations (they are made using reveal.js — get the pun?)
3. On export, Zettlr opens the exported file automatically in your preferred app. In there, hit `Cmd/Ctrl+Shift+S` (should work in most apps) to save it where ever you want.

![export.png](img/export.png)

## 6. Okay, the 5 mins are over, something else?

Nope, you're good to go. If you want to dive deeper, be sure to check out our guides:

- [Zettlr as a note-taking app](guides/guide-notes.md)
- [Zettlr as a Zettelkasten](guides/guide-zettelkasten.md)
- [Zettlr as an IDE](guides/guide-ide.md)
Loading

0 comments on commit 33c431f

Please sign in to comment.