mkdocs-magicspace update with latest tools

This commit is contained in:
vadoli 2021-08-07 16:34:50 +00:00
parent 58c5826d12
commit b01b1f6800
19 changed files with 262 additions and 507 deletions

View file

@ -30,11 +30,15 @@ workspace_meta = {
"entrypoints": ["DOCS_URL", "FILEBROWSER_URL", "STATICFS_URL", "CRONICLE_URL", "UNGIT_URL", "TERMINAL_URL", "MC_URL", "HTOP_URL"]
},
"workspace-in-docker": {
"port-range": 10,
"port-range": 15,
"entrypoints": ["DOCS_URL", "FILEBROWSER_URL", "STATICFS_URL", "CRONICLE_URL", "UNGIT_URL", "IDE_URL", "TERMINAL_URL", "MC_URL", "HTOP_URL"]
},
"codeserver-workspace": {
"port-range": 10,
"port-range": 15,
"entrypoints": ["DOCS_URL", "FILEBROWSER_URL", "STATICFS_URL", "CRONICLE_URL", "UNGIT_URL", "IDE_URL", "TERMINAL_URL", "MC_URL", "HTOP_URL"]
},
"mkdocs-magicspace": {
"port-range": 15,
"entrypoints": ["DOCS_URL", "FILEBROWSER_URL", "STATICFS_URL", "CRONICLE_URL", "UNGIT_URL", "IDE_URL", "TERMINAL_URL", "MC_URL", "HTOP_URL"]
}
}

View file

@ -1,5 +1,5 @@
ARG docker_registry=docker.io/alnoda
ARG image_tag=18.04-03
ARG image_tag=18.04-0.5
FROM ${docker_registry}/workspace-in-docker:${image_tag}
@ -10,11 +10,24 @@ COPY settings.json /home/abc/.theia/settings.json
# More dependencies for mkdocs and markdown
COPY mkdocs-requirements.txt /home/abc/installed-python-packages
# Customize mkdocs
COPY ./mkdocs/IDE.jpg /home/docs/docs/pages/home/home/
COPY ./mkdocs/showcase.md /home/docs/docs/showcase.md
COPY ./mkdocs/mkdocs.yml /home/docs/mkdocs.yml
RUN apt-get -y update \
&& echo "-------------------------------------------- weasyprint" \
&& apt-get install -y build-essential python3-dev python3-pip python3-setuptools python3-wheel python3-cffi libcairo2 libpango-1.0-0 libpangocairo-1.0-0 libgdk-pixbuf2.0-0 libffi-dev shared-mime-info \
&& echo "-------------------------------------------- mkdocs plugins" \
&& pip install -r /home/abc/installed-python-packages/mkdocs-requirements.txt
&& pip install -r /home/abc/installed-python-packages/mkdocs-requirements.txt \
&& echo "------------------------------------------------------ utils" \
&& rm -rf /home/abc/utils || true \
&& git clone https://github.com/bluxmit/alnoda-workspaces /tmp/alnoda-workspaces \
&& mv /tmp/alnoda-workspaces/utils /home/abc/ \
&& rm -rf /tmp/alnoda-workspaces \
&& echo "------------------------------------------------------ user" \
&& chown -R abc /home/abc/utils \
&& chown -R abc /home/abc/installed-python-packages
USER abc

View file

@ -1,64 +1,58 @@
# MkDocs-MagicSpace
MkDocs-MagicSpace is a higly opinionated tool, carefully crafted to develop, build and serve awesome static websites, primarily focusing
on websites for documentation, tutorials and trainings.
MkDocs-MagicSpace is an all-in-one tool, carefully crafted to develop, build and serve awesome static websites, for the purpose
of documentation, tutorials, and training.
#### Try it out
```
docker run --name space-1 -d -p 8020-8035:8020-8035 alnoda/mkdocs-magicspace
```
## Contents
* [About](#about)
* [Use-cases](#use-cases)
* [Why documentation websites](#why-documentation-websites)
* [What's included](#what's-included)
* [Features](#features)
* [The technology behind](#the-technology-behind)
* [Launch Workspace](#launch-workspace)
* [Workspace terminal](#workspace-terminal)
* [Multiple workspaces](#multiple-workspaces)
* [Open more ports](#open-more-ports)
* [Run as root](#run-as-root)
* [Docker in docker](#docker-in-docker)
* [Run on remote server](#run-on-remote-server)
* [Manage workspace](#manage-workspace)
* [Use Workspace](#use-workspace)
* [Install applications](#install-applications)
* [Schedule jobs with Cron](#schedule-jobs-with-cron)
* [Python](#python)
* [Node.js](#node.js)
* [Run applications and services inside the workspace](#run-applications-and-services-inside-the-workspace)
* [Manage workspaces](#manage-workspaces)
* [Start and stop workspaces](#start-and-stop-workspaces)
* [Create new workspace image](#create-new-workspace-image)
* [Manage workspace images](#manage-workspace-images)
* [Save and load workspace images](#save-and-load-workspace-images)
* [Use Workspace](#use-workspace)
* [First steps](#first-steps)
* [Start new documentation project](#start-new-documentation-project)
* [Customize the project](#customize-the-project)
* [Move workspace to the cloud](#move-workspace-to-the-cloud)
## About
MkDocs-MagicSpace - is a tool that you could build on your own, but we made it to save your time.
Otherwise you would waste precious hours on researching and trying open-source packages,
that are not always well-documented and conflicting each oter. You could easily miss a great package with markdown extensions,
but we selected and installed the most useful ones.
***And we have created the training website (with MkDocs-MagicSpace of course) where you can learn all the feature of this magic
workspace.***
Building good documentation is is not easy, and that's is often depioritized. MkDocs-MagicSpace is created to fight this problem.
This is probably one of the easiest way to develop and deploy awesome documentation websites.
## Use-cases
MkDocs-MagicSpace can be used for developing, building andd serving
MkDocs-MagicSpace is great to develop, build andd serve the following kinds of websites:
1. Enterprise documentation websites that unite hundreed git repositories into one documentation project, include readme files, code autodocumentation,
swagger files and jupyter notebooks.
1. Awesome looking docs for your open-source project. Use HTML & CSS to create front page and markdown for doc pages.
2. User manuals and API docs. Whils enterprise docs are for internal use, create great looking API websites for your users, and manuals for your customers.
3. Awesome looking docs for your open-source project. Use HTML & CSS to create front page and markdown for doc pages.
1. Enterprise documentation websites that unite numerous git repositories into one documentation project.
4. Tutorials and training websites. You have a lot of experience in something? Share it with the world. MkDocs-MagicSpace helps you
to highlight the code in many programming languages, properly render jupyter notebooks, complex mathematical formulas,
[Mermaid diagrams](https://mermaid-js.github.io/mermaid/#/) and so much more!
With MkDocs-MagicSpace you can also create dock, books, booklets and brochures as .pdf files.
With MkDocs-MagicSpace you can also create books, booklets and brochures as .pdf files.
One of the most convenient features of the MkDocs-MagicSpace is that it is a workspace in docker.
You use it on your local machine, you can run it on remote server and collaborate with your colleagues,
One of the most convenient features of the MkDocs-MagicSpace - is that it is a workspace in docker.
You use it on your local machine, you can run it on the remote server and collaborate with your colleagues,
you can give it to your peer as a whole. And you can use it to serve your docs from any server,
no matter if it is public or inside the company's VPN.
@ -68,22 +62,22 @@ no matter if it is public or inside the company's VPN.
- MkDocs website with beautiful themes looks much better than any readme file. The resulting documentation website looks professional and awesome.
- MkDocs adds text search to your documentation website.
- In case of closed-source software, sharing readme files from the git repository with external users is not an option.
- Github does not render beautiful extended markdown features like admonitions, tabs etc. Neither renders diagrams, formulas, swagger docs or notebooks.
- In the case of closed-source software, sharing readme files from the git repository with external users is not an option.
- Github does not render beautiful extended markdown features like admonitions, tabs, etc. Neither renders diagrams, formulas, swagger docs, or notebooks.
- Using MkDocs-MagicSpace you create documentation from the same markdown readme files you have in your repo together with the code. And you
can create unified documentation website from multiple repositories in Github, GitLab, Bitbucket.
can create a unified documentation website from multiple repositories in Github, GitLab, Bitbucket.
- You can add such features as Google Analytics, multi-language localization.
*And what about Confluent?*
The approach of having docs in different places (Git repositories, Confluent, Wiki etc.) has serious drawbacks. It creates chaos, and documentation inevitably diverge with time.
The approach of having docs in different places (Git repositories, Confluent, Wiki, etc.) has serious drawbacks. It creates chaos, and documentation inevitably diverges with time.
And you never know where to look for the information you need.
The best docs live together with the code. With MkDocs-MagicSpace you can follow this practice with ease, build documentation website
from one or many git repositories, include readme files that live close to the code. You can have a build process that even
creates autodocumentation directly from the code.
The best docs live together with the code. With MkDocs-MagicSpace you can follow this practice with ease, build a documentation website
from one or many git repositories, include readme files that live close to the code. You can have a build process that even creates
auto-documentation directly from the code.
## What's included
## Features
MkDocs-MagicSpace has [**MkDocs**](https://squidfunk.github.io/mkdocs-material/) installed with a collection of extensions and plugins
that bring MkDocs to the next level.
@ -98,21 +92,23 @@ VS-Code extensions and works in browser. This means it can run inside a docker c
- [**Cronicle**](https://github.com/jhuckaby/Cronicle) - task scheduler and runner, with a web based front-end UI. It handles both scheduled, repeating and on-demand jobs, targeting any number of worker servers, with real-time stats and live log viewer.
- [**Static File Server**](https://github.com/vercel/serve) - view any static html sites as easy as if you do it on your local machine. Serve static websites easily.
- [**Ungit**](https://github.com/FredrikNoren/ungit) - rings user friendliness to git without sacrificing the versatility of it.
- [**Midnight Commander**](https://midnight-commander.org/) - Feature rich visual file manager with internal text viewer and editor.
- [**Process Monitor**](https://htop.dev/) - Monitor running process and resource utilization.
Built on top of Base-workspace and Ubuntu-workspace, this workspace gets all the features those workspaces have.
In particular, workspace-in-docker provides excellent experience when working directly in the terminal, and has docker-in-docker.
## The technology behind
#### The technology behind
MkDocs-MagicSpace in its essense is all about
- [**MkDocs**](https://www.mkdocs.org/) - a fast, simple and downright gorgeous static site generator that's geared towards
MkDocs-MagicSpace in its essense is all about [**MkDocs**](https://www.mkdocs.org/) - a fast, simple and downright gorgeous static site generator that's geared towards
building project documentation.
- [**Material for MkDocs**](https://squidfunk.github.io/mkdocs-material/) - one of the best themes for MkDocs, makes your website look very professional, customizable,
MkDocs has many themes, MkDocs-MagicSpace has [**Material for MkDocs**](https://squidfunk.github.io/mkdocs-material/) set up and configured by default.
It is one of the best themes for MkDocs, which makes your website look very professional. This theme is extremely customizable,
searchable, mobile-friendly, has 40+ languages, has built-in search. It also adds lots of markdown features such as tabbed content containers, mathematical formulas, critic markup,
task lists, and more than 10k icons and emojis.
and lots of packages and extensions that greatly improve your capabilities, these are only some of them
MkDocs-MagicSpace has lots of packages and extensions already installed:
- [PyMdown Extensions](https://facelessuser.github.io/pymdown-extensions/) - add even more cool features of the extended markdown: sub- and superscripts, keys, magic links, sane headers etc.
- [Mkdocs-macro plugin](https://mkdocs-macros-plugin.readthedocs.io/en/latest/) - add variables and macros written in Python!
@ -123,10 +119,9 @@ and lots of packages and extensions that greatly improve your capabilities, thes
- [Mkdocs-include-markdown-plugin](https://github.com/mondeja/mkdocs-include-markdown-plugin) - include Markdown files completely or partially, and include files of any type.
- [Mkdocs-table-reader-plugin]() - directly insert CSV files as tables in your website.
***We don't just install all these packages, and let you research how to use them on your own. We have created a training website where you can learn
how to get the most out of the MkDocs-MagicSpace, its features and markdown extensions***
**(The complete list of installed packages - /home/abc/installed-python-packages/mkdocs-requirements.txt)**
## Launch workspace
## Launch Workspace
Workspaces - are merely docker containers, that's why managing workspaces is easy and intuitive - it is enough to know only docker commands,
no need to learn any new tools.
@ -134,29 +129,38 @@ no need to learn any new tools.
In order to avoid confusion, the following convention is adopted:
```sh
command to execute outside sof the workspace
command to execute outside of the workspace
```
> `command to execute inside the workspace (after entering running docker container)`
To start MkDocs-MagicSpace execute in terminal
To start a workspace simply execute in terminal
```sh
docker run --name space-1 -d -p 8020-8030:8020-8030 alnoda/mkdocs-magicspace
docker run --name space-1 -d -p 8020-8035:8020-8035 alnoda/mkdocs-magicspace
```
*(It is recommended to run workspace in the daemon mode)*
***Open [http://localhost:8020](http://localhost:8020)***
Workspace has web-based documentation with home page, from where you can open any workspace tool.
It is recommended to run workspace in the daemon mode.
Workspace has its own UI, which includes quiklaunch (home) page and documentation pages.
From the quiklaunch you can open any workspace tool. Documentation pages you modify in order
to document the project, workspace use and setup.
### Workspace terminal
There are 2 ways how to work with terminal inside the mkdocs-magicspace:
There are several ways how to work with terminal of the the mkdocs-magicspace:
- built-it in-browser terminal
- use terminal provided by in-browser IDE [http://localhost:8025](http://localhost:8025) ([unless other ports are mapped](#multiple-workspaces))
- enter running workspace docker container from your terminal
- ssh into the running the docker container (of the workspace) from your terminal
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/base-workspace/img/base-workspace-terminal.gif" alt="Base-Workspace terminal" width="500">
</p>
*(Browser-based terminals always work under the user you started the workspace with, the default is non root user "abc")*
If you want to enter running workspace container from your terminal execute:
```sh
@ -168,94 +172,215 @@ If you don't want to use z-shell
docker exec -it space-1 /bin/bash
```
This way allows to ssh into the workspace as a root user at any time, even if the workspace itself was not starter as root user (the default user is abc)
```sh
docker exec -it --user=root space-1 /bin/zsh
```
You can work in Ubuntu terminal now. Execute the followinng command to know your workspace user
> `whoami`
### Multiple workspaces
Every workspace requires range of ports. If one workspace is up and running, the ports 8020-8030 are taken.
Every workspace requires range of ports. If one workspace is up and running, the ports 8020-8035 are taken.
In order to start another workspace it is necessary either to stop currently runnning workspace, or to run another workspace
mkdocs-magicspace itself uses 9 ports (8020-8028), but it is recommended to map several extra ports just in case. Having extra ports,
you can always launch new applications on these ports, and they will be immediately exposed outside of the workspace.
In order to start another workspace, you either need to stop currently runnning workspace, or to run another workspace
on the different port range.
If you are planning to run multiple workspaces at the same time, you can run second workspace with different port range
If you are planning to run more than one workspace at the same time, you can run another workspace with
the different port range, for example
```sh
docker run --name space-2 -d -p 8040-8050:8020-8030 -e ENTRY_PORT=8040 alnoda/mkdocs-magicspace
docker run --name space-2 -d -p 8040-8055:8020-8035 -e ENTRY_PORT=8040 alnoda/mkdocs-magicspace
```
Notice that in addition we need to set environmental variable ENTRY_PORT, which should be equal to the first port in the new range.
This is needed for the documentation main page to set up correct links to other tools (Filebrowser, Cronicle etc.)
Workspace UI usues this variable to know the new port range, and redirects to the proper addresses of the workspace applications' UIs.
### Open more ports
We started workspace container with a port range mapped "-p 8020-8030". If you are planning to expose more applications
We started workspace container with a port range mapped "-p 8020-8035". If you are planning to expose more applications
from inside of a container, add additional port mapping, for example
```sh
docker run --name space-1 -d -p 8020-8030:8020-8030 -p 8080:8080 alnoda/mkdocs-magicspace
docker run --name space-1 -d -p 8020-8035:8020-8035 -p 8080:8080 alnoda/mkdocs-magicspace
```
You can add multiple port mappings:
```sh
docker run --name space-1 -d -p 8020-8030:8020-8030 -p 8080:8080 -p 443:443 alnoda/mkdocs-magicspace
docker run --name space-1 -d -p 8020-8035:8020-8035 -p 8080:8080 -p 443:443 alnoda/mkdocs-magicspace
```
**NOTE:** It is not a problem if you don't expose any ports, but later on realise you need them -
you will just create new image, and run it exposing the required port (look in the section [Create new image](#create-new-workspace-image))
### Run as root
The default user is **abc** with passwordless sudo to install packages. If you'd rather work as root, then you should ssh into running container as
```sh
docker exec -it --user=root space-1 /bin/zsh
```
You can of course open several terminals to the same running containner as both abc and root users at the same time.
you will just create new image, and run it exposing the required port (look in the section [Create new image](#create-new-image))
### Docker in docker
It is possible to work with docker directly from the workspace. In order to be able to use docker directly inside the workspace,
start the workspace with mounting `/var/run/docker.sock` and using root user:
It is possible to work with docker directly from the workspace (using workspace terminal).
```
docker run --name space-1 -d -p 8020-8030:8020-8030 -v /var/run/docker.sock:/var/run/docker.sock --user=root alnoda/mkdocs-magicspace
docker run --name space-1 -d -p 8020-8035:8020-8035 -v /var/run/docker.sock:/var/run/docker.sock alnoda/mkdocs-magicspace
```
Alternatively you can run workspace as non-root
NOTE: in order to use docker in docker you need to or enter into the workspace container as root
```sh
docker run --name space-1 -d -p 8020-8030:8020-8030 -v /var/run/docker.sock:/var/run/docker.sock alnoda/mkdocs-magicspace
```
but whenever you want to use docker enter into the workspace container as root
```
docker exec -it --user=root space-1 /bin/zsh
```
### Run on remote server
Because workspace is just a docker image, running it in cloud is as easy as running it on local laptop. There are only 3 steps involved:
Because workspace is just a docker image, running it in any other server is as easy as running it on local laptop.
Running on remote server makes it much simpler to collaborate, because you can just share credentials to the workspace with your peers, and they will be able to use it.
You can also run applications that should run permanently, and run jobs on schedule.
#### Unsecure remote workspace
The simplest deployment of the workkspace requires only 3 steps:
- get virtual server on your favourite cloud (Digital Ocean, Linode, AWS, GC, Azure ...)
- [install docker](https://docs.docker.com/engine/install/) on this server
- ssh to the remote server and start workspace with envronmental variable `-e WRK_HOST="<ip-of-your-remote-server>"`
- ssh to the remote server and start workspace
```
docker run --name space-1 -d -p 8020-8030:8020-8030 -e WRK_HOST="<ip-of-your-remote-server>" alnoda/mkdocs-magicspace
docker run --name space-1 -d -p 8020-8035:8020-8035 -e WRK_HOST="<ip-of-your-remote-server>" alnoda/mkdocs-magicspace
```
if docker-in-docker needed then
**NOTE:** When running workspace on the remote server, add envronmental variable `-e WRK_HOST="<ip-of-your-remote-server>"`.
Workspace UI needss this variable to know how redirect properly to the workspace applications' UIs.
Open in your browser `<ip-of-your-remote-server>:8020`
If docker-in-docker is required, then
```
docker run --name space-1 -d -p 8020-8030:8020-8030 -e WRK_HOST="<ip-of-your-remote-server>" -v /var/run/docker.sock:/var/run/docker.sock alnoda/mkdocs-magicspace
docker run --name space-1 -d -p 8020-8035:8020-8035 -e WRK_HOST="<ip-of-your-remote-server>" -v /var/run/docker.sock:/var/run/docker.sock alnoda/mkdocs-magicspace
```
Open in your browser `<ip-of-your-remote-server>:8020`
This way launches workspace in cloud, but such workspace is not secure, everyone who knows IP of your server will be able to use it.
When running mkdocs-magicspace on the remote server, it is useful to add authentication mechanism, otherwise anyone in the world
who gets to know the IP of the remote server will be able to use your workspace. We have created a docker-compose file, that will
let you launching workspace with authentication - [read the instructions here](https://github.com/Alnoda/workspaces-in-docker/blob/main/workspaces/mkdocs-magicspace/md/auth-for-remote-workspace.md)
#### Secure remote workspace
> [Check out the complete docs](https://alnoda.org) to know more.
*You might want to restrict access to the workspace, and secure encrypted communication with the workspace*
## Manage workspace
Kkdocs-MagicSpace contains utility that will generate everything needed to launch the workspace in cloud in a secure way, with authentication and with TLS.
If you want to run workspace on the remote server securely, start mkdocs-magicspace on your local laptop first, open its terminal and
use utility `/home/abc/utils/remote.py` to generate create docker-compose project with TLS certificates. Simply execute
> `python /home/abc/utils/remote.py --workspace="mkdocs-magicspace" --port="8020" --host="68.183.69.198" --user="user1" --password="pass1"`
**NOTE:** you have to specify the correct host (IP of the server you want to run the workspace on), and user and password of your choice.
You see folder `/home/abc/utils/remote` is created. Copy this folder to the remote server (any location). Ssh to the server, cd into
the directory you copied and execute `docker-compose up -d`.
That's it, you workspace is running securely on the remote server, using
self-signed TLS certificates for encrypted https communication between you laptop and the remote workspace,
and authentication is added.
## Use Workspace
Among the common actions you'd do in the workspace are
- installation of new applications and runtimes
- edit files, write code, scripts
- build, compile and execute code
- start/stop applications and services
- schedule tasks and scripts
- process data
### Install applications
Use workspace workspace terminal to install new applications.
Install with ```sudo apt install```. The default *abc* user is allowed to install packages.
For example, in order to install [Emacs text editor](https://www.gnu.org/software/emacs/) open workspace terminal, and execute
> `sudo apt install emacs`
### Schedule jobs with Cron
Schedule execution of any task with cron - a time-based job scheduler in Unix-like computer operating systems.
Open workspace terminal, and execute
> `crontab -e`
*(chose [1] nano as editor on the first time)*
In the end of the opened file add line
> `* * * * * echo $(whoami) >> /home/cron.txt`
This will print every minute username to file */home/cron.txt* . *(Hit Ctrl+X to exit nano)*
Hint: example of cron job definition:
```
.---------------- minute (0 - 59)
| .------------- hour (0 - 23)
| | .---------- day of month (1 - 31)
| | | .------- month (1 - 12) OR jan,feb,mar,apr ...
| | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
| | | | |
* * * * * command to be executed
```
**NOTE** you can disconnect from the image and close terminal - cron will continue working.
> Instead of cron you might want to use Cronicle - a tool with Web UI, and a great list of features
> that will provide you with the dashboard, list of executions and statistics, even let you ser limis
> on resources for each jobs, and create depenndencies between jobs.
### Python
Python and Pip are installed. To use python console, open workspace terminal and execute
> `python`
install python package with pip, for
> `pip install pandas`
If you are planning to work with python, we recommend to install IPython, that provides a rich toolkit to help
you make the most of using Python interactively. Install and start ipython
> ```pip install ipython```
> `ipython`
### Node.js
We recommend to use nodeenv to create different node environments.
For example, open workspace terminal, create folder npmgui, and activate environment with node v. 12.18.3 and npm v.6.0.0
> `cd /home`
> `mkdir npmgui; cd npmgui`
> `nodeenv --node=12.18.3 --npm=6.0.0 env`
Let's install package and start node application
> `. env/bin/activate && npm i -g npm-gui`
> `npm-gui 0.0.0.0:8030`
Open your browser on http://localhost:8030/
**NOTE:** If you close terminal, the application will stop. See how to [start applications that reamin live after closing a workspace terminal](#run-applications-and-services-inside-the-workspace)
### Run applications and services inside the workspace
If you want application to keep running after workspace terminal is closed start it with **"&!"** at the end.
For example, in the last section we started *npm-gui* tool with command `npm-gui 0.0.0.0:8030`. If you close the workspace terminal,
this application witll stop running. To keep it running after terminal is closed, execute
> `npm-gui 0.0.0.0:8030 &!`
Now, if you disconnect from the workspace and close terminal, the application will continue running in the workspace, untill [workspace is stopped](#start-and-stop-workspaces).
## Manage workspaces
Workspace is just a docker container. You can start, stop, delete and do anything you can do with docker images and containers.
@ -263,7 +388,7 @@ There are two concepts to keep in mind: **images** and **containers**. Images ar
is an image. When you execute this command
```sh
docker run --name space-1 -d -p 8020-8030:8020-8030 alnoda/mkdocs-magicspace
docker run --name space-1 -d -p 8020-8035:8020-8035 alnoda/mkdocs-magicspace
```
you create container called **space-1** from the image **alnoda/mkdocs-magicspace**. You can create any number of containers, but you need to
[map different ports to each of them](#multiple-workspaces).
@ -278,7 +403,7 @@ Essentially, this means *"take my workspace and create new image with all the ch
The workspace started in daemon mode will continue working in the background.
See all the running docker containers (including workspaces)
See all the running docker containers
```
docker ps
@ -345,9 +470,9 @@ docker rmi -f alnoda/mkdocs-magicspace
### Save and load workspace images
After you commit workspace container, and create new image out of it, you can push it to your docker registry or save it as a file.
After you commit workspace container, and create new image out of it, you can push it to your docker registry or save it in a file.
#### Save workspace as file
#### Save workspace in a file
Assuming you created new image **space-image:0.4** from your workspace, you can save it as a tar file
@ -367,7 +492,7 @@ And restore it from the tar file
docker load < space-image-0.4.tar
```
#### Push workspace to private docker registry
#### Push workspace to a registry
A better way to manage images is docker registries. You can use docker registries in multiple clouds. They are cheap annd very convenient.
Check out for example, [Registry in DigitalOcean](https://www.digitalocean.com/products/container-registry/) or in [Scaleway container registry](https://www.scaleway.com/en/container-registry/). There are more.
@ -376,82 +501,30 @@ Pushing image to registry is merely 2 extra commands: 1) tag image; 2) push imag
You will be able to pull image on any device, local or cloud.
## Use workspace
### Move workspace to the cloud
### First steps
Ease of running workspace in cloud, and ability to move workspaces between local machine and remote server -
is one of the main features of the workspace, and the reasonn why the workspace is entirely in docker.
In the workspace you will typically work with the IDE and use terminal often.
It is often a case that experiment, which started on personal notebook require more computational
resources, must be running for a long period of time, or executed periodically. All of these cases are
the reasons to move a workspace to the cloud server. Usually it is a hassle, but this workspace can be moved
to the remote server easily.
Open worspace UI at [*http://localhost:8020*](http://localhost:8020) (unless you mapped other ports), go to the **Home** page
and click on the IDE icon to open WEB-based version of Visual Studio Code. When you open IDE, click on *Terminal* in the upper
toolbar and then on the **New Terminal**.
Terminal allows you to run scripts, compile code, build applications, install new software,
[use docker](#docker-in-docker), deploy and serve web applications etc.
We recommend to keep all your projects in folder `/home/project`. In terminal this folder has a shortcut `~p` (try executing `cd ~p`).
### Start new documentation project
The first thing when starting a new documentation project, is to copy the mkdocs boilerplate to your project folder.
There boilerplate for MkDocs is already available in folder `/home/docs`. This boilerplate is actually used as WEB UI for most workspaces, and served by the
mkdocs server with the live reload, available at *http://localhost:8020* by default.
Copy existing mkdocs boilerplate to your project folder. Let's assume your project is called **awesome-project**
> `cp -r /home/docs /home/project/awesome-project`
Now you can start live development server that would serve this boilerplate
documentation website. We will serve it on port 8026, because it falls in the range
of ports we provided for the workspace upon creation (unless you've mapped other ports)
> `cd /home/project/awesome-project && mkdocs serve -a 0.0.0.0:8026`
Open your browser on [*http://localhost:8026*](http://localhost:8026) and you will see
another workspace WEB UI up and running.
At this moment you might want to initialize a git repository, make first commit and push
the code to remote.
### Customize the project
You probably want your documentation website to look different from the workspace WEB UI.
There are 2 adjustments you would typically do:
1. Create, update and delete doc pages, or include docs from other projects and repositories
2. Customize the appearance of your documentation website
The key configuration happens in the file `mkdocs.yaml`, which is always in the root folder of the mkdocs project.
It is in this file we specify what markdown files should be shown, and what is the order. In this file we also configure the appearance of the whole
documentation website, and list the plugins that should be used.
if we look in the file `mkdocs.yaml` of the boilerplate MkDocs project, that we copied into `/home/project/awesome-project` we will
see entry called `nav`
```
nav:
- Home: pages/home/home.md
- About: README.md
- Get started: get-started.md
```
here we list all the makdown files from the subfolder `docs` that should be shown in our documenntation website. We can create
nested structures
```
nav:
- Home: pages/home/home.md
- About:
- Mission: mission.yaml
- Team: team.yaml
- Get started:
- First steps: get-started/first-steps.yaml
- Customization: get-started/customization.yaml
```
***We have created documentation website for MkDocs-MagicSpace. You can learn how to customize your MkDocs project and use extended markdown to create awesome doc projects.***
The easiest way to move workspace to the cloud is to get your private docker registry. Then moving a workspace from a laptop to
a remote server is only 3 commands:
1. [Commit workspace to the a image](#create-new-workspace-image)
2. [Push workspace to your docker registry](https://docs.docker.com/engine/reference/commandline/push/)
3. ssh to remote server, and [run workspace there](#run-on-remote-server)
If you don't want to use container registry, then there are 2 steps more involved:
1. [Commit workspace to the a image](#create-new-workspace-image)
2. [Save image to file](save-and-loa-images)
3. Copy file to remote server. There are many options:
- Launch filexchange workspace on the remote server
- Use [cyberduck](https://cyberduck.io/)
- use [scp](https://linuxize.com/post/how-to-use-scp-command-to-securely-transfer-files/)
4. [Load workspace image from file](#save-and-load-workspace-images) on the remote server
5. [Start workspace on the remote server](#run-on-remote-server)

View file

@ -1,68 +0,0 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
# Translations
*.mo
# Scrapy stuff:
.scrapy
# PyBuilder
target/
# IPython Notebook
.ipynb_checkpoints
# pyenv
.python-version
# virtualenv
venv/
ENV/
# MkDocs documentation
site/

Binary file not shown.

After

Width:  |  Height:  |  Size: 476 KiB

View file

@ -1,25 +0,0 @@
**This is a starting point to create docs for this workspace!**
In order to change this page, simply modify the file `/home/docs/docs/README.md`. Changes will be applied automatically.
In order to add a new doc file, it is enough to create a file in the folder `/home/docs/docs` and add respective entry
to the configuratiion file `/home/docs/mkdcs.yaml`.
For example, [enter the terminal in the workspace](get-started.md#workspace-terminal),
and create new documentation file with some text at your will, and save changes
> `nano /home/docs/docs/new.md`
edit file `mkdcs.yaml`
> `nano /home/docs/mkdcs.yaml`
Add record about the new file to **nav**, and save changes
```yaml
nav:
- Home: pages/home/home.md
- About: README.md
- Get started: get-started.md
- New: new.md
```

View file

@ -1,70 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="1280" height="1024" viewBox="0 0 10000 9600" xml:space="preserve">
<desc>Created with Fabric.js 3.6.3</desc>
<defs>
</defs>
<g transform="matrix(2,0,0,2,640,512)" id="background-logo" >
</g>
<g transform="matrix(2,0,0,2,640,416.3)" id="logo-logo" >
<g transform="matrix(18.9,0,0,24.4,-502.2,-1009.3)" style="" paint-order="stroke" >
<g transform="matrix(0.2,0,0,-0.2,0,-61.6)" >
<path style="fill: rgb(64, 50, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1625,-1745)" d="M 3062 1050.1 c -466.3 107.3 -950.8 107.3 -1417.1 0 c -16.2 -3.7 -26.6 -18.2 -23.3 -32.1 c 3.4 -13.9 19 -22.1 34.9 -18.4 c 458.6 105.5 935.2 105.5 1393.9 0 c 15.9 -3.7 31.5 4.5 34.9 18.4 c 3.4 13.9 -7 28.4 -23.3 32.1" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-95.7,12.6)" >
<path style="fill: rgb(64, 50, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1210,-1423.3)" d="M 1847.7 878.7 c 0 52.1 44.1 94.1 97 90.6 c 48.2 -3.2 84.6 -45.5 84.6 -93.8 V 490.5 c 0 -14.3 11.6 -25.9 25.9 -25.9 c 14.3 0 25.9 11.6 25.9 25.9 v 384 c 0 76.7 -58.8 142.8 -135.5 146.6 c -81.9 4 -149.8 -61.4 -149.8 -142.5 V 490.5 c 0 -14.3 11.6 -25.9 25.9 -25.9 c 14.3 0 25.9 11.6 25.9 25.9 v 388.2" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-111.1,21.9)" >
<path style="fill: rgb(81, 173, 229); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1143.2,-1383.2)" d="M 1861.3 912.4 v -419.2 c 0 -5.8 4.7 -10.4 10.4 -10.4 c 5.7 0 10.4 4.7 10.4 10.4 v 419.2 c 0 5.8 -4.6 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-103.4,18.6)" >
<path style="fill: rgb(81, 173, 229); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1176.6,-1397.2)" d="M 1894.7 940.4 v -447.2 c 0 -5.8 4.7 -10.5 10.4 -10.5 c 5.7 0 10.4 4.7 10.4 10.5 v 447.2 c 0 5.8 -4.6 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-95.7,17.5)" >
<path style="fill: rgb(81, 173, 229); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1210,-1401.8)" d="M 1928.1 949.5 v -456.1 c 0 -5.9 4.6 -10.6 10.4 -10.6 c 5.7 0 10.4 4.8 10.4 10.6 v 456.1 c 0 5.9 -4.6 10.7 -10.4 10.7 c -5.7 0 -10.4 -4.8 -10.4 -10.7" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-88,18.6)" >
<path style="fill: rgb(81, 173, 229); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1243.4,-1397.2)" d="M 1961.5 939.8 v -445.9 c 0 -6.1 4.6 -11.1 10.4 -11.1 c 5.7 0 10.4 5 10.4 11.1 v 445.9 c 0 6.1 -4.7 11.1 -10.4 11.1 c -5.7 0 -10.4 -5 -10.4 -11.1" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-80.3,21.9)" >
<path style="fill: rgb(81, 173, 229); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1276.8,-1383.2)" d="M 1994.9 912.4 v -419.2 c 0 -5.8 4.6 -10.4 10.4 -10.4 c 5.7 0 10.4 4.7 10.4 10.4 v 419.2 c 0 5.8 -4.7 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,0,12.6)" >
<path style="fill: rgb(64, 50, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1625,-1423.3)" d="M 2262.7 878.7 c 0 52.1 44.1 94.1 97 90.6 c 48.2 -3.2 84.6 -45.5 84.6 -93.8 V 490.5 c 0 -14.3 11.6 -25.9 25.9 -25.9 c 14.3 0 25.9 11.6 25.9 25.9 v 384 c 0 76.7 -58.8 142.8 -135.5 146.6 c -81.9 4 -149.8 -61.4 -149.8 -142.5 V 490.5 c 0 -14.3 11.6 -25.9 25.9 -25.9 c 14.3 0 25.9 11.6 25.9 25.9 v 388.2" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-15.4,21.9)" >
<path style="fill: rgb(191, 27, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1558.2,-1383.2)" d="M 2276.3 912.4 v -419.2 c 0 -5.8 4.7 -10.4 10.4 -10.4 c 5.7 0 10.4 4.7 10.4 10.4 v 419.2 c 0 5.8 -4.6 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,-7.7,18.6)" >
<path style="fill: rgb(191, 27, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1591.6,-1397.2)" d="M 2309.7 940.4 v -447.2 c 0 -5.8 4.7 -10.5 10.4 -10.5 c 5.7 0 10.4 4.7 10.4 10.5 v 447.2 c 0 5.8 -4.6 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,0,17.5)" >
<path style="fill: rgb(191, 27, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1625,-1401.8)" d="M 2343.1 949.5 v -456.1 c 0 -5.9 4.6 -10.6 10.4 -10.6 c 5.7 0 10.4 4.8 10.4 10.6 v 456.1 c 0 5.9 -4.6 10.7 -10.4 10.7 c -5.7 0 -10.4 -4.8 -10.4 -10.7" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,7.7,18.6)" >
<path style="fill: rgb(191, 27, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1658.4,-1397.2)" d="M 2376.5 939.8 v -445.9 c 0 -6.1 4.6 -11.1 10.4 -11.1 c 5.7 0 10.4 5 10.4 11.1 v 445.9 c 0 6.1 -4.7 11.1 -10.4 11.1 c -5.7 0 -10.4 -5 -10.4 -11.1" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,15.4,21.9)" >
<path style="fill: rgb(191, 27, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1691.8,-1383.2)" d="M 2409.9 912.4 v -419.2 c 0 -5.8 4.6 -10.4 10.4 -10.4 c 5.7 0 10.4 4.7 10.4 10.4 v 419.2 c 0 5.8 -4.7 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,95.7,12.6)" >
<path style="fill: rgb(64, 50, 44); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-2040,-1423.3)" d="M 2677.7 878.7 c 0 52.1 44.1 94.1 97 90.6 c 48.2 -3.2 84.6 -45.5 84.6 -93.8 V 490.5 c 0 -14.3 11.6 -25.9 25.9 -25.9 c 14.3 0 25.9 11.6 25.9 25.9 v 384 c 0 76.7 -58.8 142.8 -135.5 146.6 c -81.9 4 -149.8 -61.4 -149.8 -142.5 V 490.5 c 0 -14.3 11.6 -25.9 25.9 -25.9 c 14.3 0 25.9 11.6 25.9 25.9 v 388.2" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,80.3,21.9)" >
<path style="fill: rgb(128, 204, 40); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-1973.2,-1383.2)" d="M 2691.3 912.4 v -419.2 c 0 -5.8 4.7 -10.4 10.4 -10.4 c 5.7 0 10.4 4.7 10.4 10.4 v 419.2 c 0 5.8 -4.6 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,88,18.6)" >
<path style="fill: rgb(128, 204, 40); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-2006.6,-1397.2)" d="M 2724.7 940.4 v -447.2 c 0 -5.8 4.7 -10.5 10.4 -10.5 c 5.7 0 10.4 4.7 10.4 10.5 v 447.2 c 0 5.8 -4.6 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,95.7,17.5)" >
<path style="fill: rgb(128, 204, 40); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-2040,-1401.8)" d="M 2758.1 949.5 v -456.1 c 0 -5.9 4.6 -10.6 10.4 -10.6 c 5.7 0 10.4 4.8 10.4 10.6 v 456.1 c 0 5.9 -4.6 10.7 -10.4 10.7 c -5.7 0 -10.4 -4.8 -10.4 -10.7" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,103.4,18.6)" >
<path style="fill: rgb(128, 204, 40); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-2073.4,-1397.2)" d="M 2791.5 939.8 v -445.9 c 0 -6.1 4.6 -11.1 10.4 -11.1 c 5.7 0 10.4 5 10.4 11.1 v 445.9 c 0 6.1 -4.7 11.1 -10.4 11.1 c -5.7 0 -10.4 -5 -10.4 -11.1" stroke-linecap="round" />
</g>
<g transform="matrix(0.2,0,0,-0.2,111.1,21.9)" >
<path style="fill: rgb(128, 204, 40); fill-rule: nonzero; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; stroke-dasharray: none; stroke-dashoffset: 0; stroke-miterlimit: 4; opacity: 1" paint-order="stroke" transform="translate(-2106.8,-1383.2)" d="M 2824.8 912.4 v -419.2 c 0 -5.8 4.6 -10.4 10.4 -10.4 c 5.7 0 10.4 4.7 10.4 10.4 v 419.2 c 0 5.8 -4.7 10.4 -10.4 10.4 c -5.7 0 -10.4 -4.7 -10.4 -10.4" stroke-linecap="round" />
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

View file

@ -1,16 +0,0 @@
window.MathJax = {
tex: {
inlineMath: [["\\(", "\\)"]],
displayMath: [["\\[", "\\]"]],
processEscapes: true,
processEnvironments: true
},
options: {
ignoreHtmlClass: ".*|",
processHtmlClass: "arithmatex"
}
};
document$.subscribe(() => {
MathJax.typesetPromise()
})

View file

@ -1,105 +0,0 @@
<style>
/* These styles apply only to this page! */
.md-content__button {
display: none;
}
.md-typeset h1 {
line-height: 0;
margin: 0;
margin-left: -9999px;
}
.quickstart-wrapper {
min-width: 300px;
display: flex;
flex-wrap: wrap;
justify-content: center;
padding-left: -50px;
column-gap: 50px;
row-gap: 50px;
}
.quickstart-wrapper > div {
flex: 300px;
max-width: 300px;
}
.tool-img{
box-shadow: rgba(0, 0, 0, 0.24) 0px 5px 5px;
border-radius: 5px;
}
.tool-caption{
font-family: Roboto, Helvetica, sans-serif;
text-align: center;
margin-top: 10px;
font-size: 1.2rem;
font-weight: bold;
/* font-size: 1.25em;
font-weight: 400; */
letter-spacing: -.02em;
line-height: 1.5;
}
.tool-description{
font-family: Helvetica, sans-serif;
text-align: center;
margin-top: 10px;
font-size: 0.7rem;
font-style: oblique;
/* font-weight: bold; */
}
</style>
{%
set tools = [
{
"env": "IDE_URL",
"name": "IDE",
"image": "Theia.png",
"description": "Powerful WEB-based IDE. Open source version of Visual Studio Code. Develop code in any language, install thousands of extensions or work in terminal directly from IDE"
},
{
"env": "FILEBROWSER_URL",
"name": "File Browser",
"image": "Filebrowser.png",
"description": "Browse files inside running docker container. Upload and download files and folders to and from your Workspace, no matter where your Workspace is running: on local or in cloud"
},
{
"env": "CRONICLE_URL",
"name": "Cronicle",
"image": "Cronicle.png",
"description": "Schedule jobs, tasks and bacground scripts. Powerful tool to manage schedules, observe and monitor executions."
},
{
"env": "UNGIT_URL",
"name": "Ungit",
"image": "Ungit.png",
"description": "Manage Git repositories and work flow using beautiful UI"
},
{
"env": "STATICFS_URL",
"name": "Static File Server",
"image": "Static-server.png",
"description": "Serve any static websites like a breeze"
}
]
%}
<div class="quickstart-wrapper">
{% for tool in tools %}
{% set tool_url = get_tool_url(tool.env) %}
<div>
<a href="{{ tool_url }}" target="_blank" rel="noopener noreferrer">
<img src="{{ tool.image }}" class="tool-img"/>
</a>
<a href="{{ tool_url }}">
<div class="tool-caption">{{ tool.name }}</div>
</a>
<div class="tool-description">{{ tool.description }}</div>
</div>
{% endfor %}
</div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 870 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 303 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 553 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 553 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 587 KiB

View file

@ -1,51 +0,0 @@
"""
Basic example of a Mkdocs-macros module.
Include this {{ macros_info() }} in any page to get complete macro info
"""
import os
port_increments = {
"DOCS_URL": 0,
"FILEBROWSER_URL": 1,
"STATICFS_URL": 2,
"CRONICLE_URL": 3,
"UNGIT_URL": 4,
"IDE_URL": 5
}
# this function name should not be changed
def define_env(env):
"""
This is the hook for defining variables, macros and filters
- variables: the dictionary that contains the environment variables
- macro: a decorator function, to declare a macro.
- filter: a function with one of more arguments,
used to perform a transformation
"""
@env.macro
def get_tool_url(env):
try:
return os.environ[name]
except:
# Get host
host = "localhost"
try:
host = os.environ["WRK_HOST"]
except:
pass
# Entry port - port relative to which other ports will be calculated
entry_port = 8020
try:
entry_port = int(os.environ["ENTRY_PORT"])
except:
pass
# Assign port
try:
port = port_increments[env] + entry_port
except:
port = 80
return f"http://{host}:{port}"