From 9aed2f4727a65378fbfb37879cc471e0ba3a222e Mon Sep 17 00:00:00 2001 From: gd Date: Thu, 23 Dec 2021 21:16:51 +0300 Subject: [PATCH] add docs --- docs/README.md | 19 +++ docs/config.yaml | 30 +++++ docs/layouts/base.j2 | 27 +++++ docs/layouts/index.j2 | 9 ++ docs/pages/Peji-1.0.tar.gz | Bin 0 -> 6015 bytes docs/pages/configuration.md | 84 +++++++++++++ docs/pages/downloads.md | 18 +++ docs/pages/index.md | 66 +++++++++++ docs/pages/peji_jp_speech.mp3 | Bin 0 -> 3806 bytes docs/pages/quickstart.md | 157 +++++++++++++++++++++++++ docs/themes/default/css/main.css | 103 ++++++++++++++++ docs/themes/default/images/favicon.ico | Bin 0 -> 1150 bytes 12 files changed, 513 insertions(+) create mode 100644 docs/README.md create mode 100644 docs/config.yaml create mode 100644 docs/layouts/base.j2 create mode 100644 docs/layouts/index.j2 create mode 100644 docs/pages/Peji-1.0.tar.gz create mode 100644 docs/pages/configuration.md create mode 100644 docs/pages/downloads.md create mode 100644 docs/pages/index.md create mode 100644 docs/pages/peji_jp_speech.mp3 create mode 100644 docs/pages/quickstart.md create mode 100644 docs/themes/default/css/main.css create mode 100644 docs/themes/default/images/favicon.ico diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..d95b330 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,19 @@ +# Pēji site + +Pēji documentation. + +# Build + +Install Pēji first: + +``` +pip install Peji +``` + +Build: + +``` +peji build +``` + +Done! diff --git a/docs/config.yaml b/docs/config.yaml new file mode 100644 index 0000000..33d68b8 --- /dev/null +++ b/docs/config.yaml @@ -0,0 +1,30 @@ +# Site title. +title: Pēji +# Site meta description. +description: Stupidly simple static site generator. +# Site default theme. +theme: default +# Site menu. +menu: + Home: / + Quickstart: /quickstart.html + Configuration: /configuration.html + Downloads: /downloads.html + Source Code: https://gitea.gch.icu/ge/peji + Other Projects: https://gitea.gch.icu/ge +# Markdown extensions. +# See https://python-markdown.github.io/extensions/ +markdown_extensions: + - admonition + - codehilite + - extra + - meta + - toc +markdown_extension_configs: + codehilite: + noclasses: true + use_pygments: true + pygments_style: default + toc: + title: Table of contents + toc_depth: 2-5 diff --git a/docs/layouts/base.j2 b/docs/layouts/base.j2 new file mode 100644 index 0000000..213f5f2 --- /dev/null +++ b/docs/layouts/base.j2 @@ -0,0 +1,27 @@ + + + + + + + {% block title %}{% endblock %} + + {% block head %}{% endblock %} + + +

Pēji

+Stupidly simple static site generator. +{% if menu %} + +{% endif %} +{% block content %} +Nothing here. +{% endblock %} + + \ No newline at end of file diff --git a/docs/layouts/index.j2 b/docs/layouts/index.j2 new file mode 100644 index 0000000..7bfd360 --- /dev/null +++ b/docs/layouts/index.j2 @@ -0,0 +1,9 @@ +{% extends 'base.j2' %} +{% block title %}{{ title }} | {{ site_title }}{% endblock %} +{% block head %}{{ super() }} + + +{% endblock %} +{% block content %} + {{ content | safe }} +{% endblock %} diff --git a/docs/pages/Peji-1.0.tar.gz b/docs/pages/Peji-1.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..5ac8772af11fd50e2cba4343812ae9ec2a366d0c GIT binary patch literal 6015 zcma)+S2P=d!^LCAp0#%rwUyQuYR^(ih`qIT?7eE#R(nNJs;Jo1-YfQ|MjNxJt!DC# z|Lgbgz1(xpx%d3exi6P30SLSagjr!@^z7d`3yKPf2zgt30gmO?eAm>yLWhhmXLE68 zwIU_fV{G}fwB~bUsJ?(kQOGk%aa?f?2zw8pm}>|H^QwoZ%I;{Lrw#{e?5e$ayWX0f zUd;eqsczrnEEZl^f4kuG-h1vV(-pWdM?$#G`C@C7PJ=Yf?S9RvQDW8+>HgAmVv*YS zVw-Z7GZ6{+5q9oVzDSm@GMVU?51lC7)wOkmjW0X9H?BeRSE)16yK{tLC-Zr#rD(kS z9+l3{w)n98wfv-`&7qG16o+i+kiM5}u*cU&?T72eXpA_6CYt}YcDp+r!vhYsWFjF? z?w-EeTwQL}LAy7u9{1h3zhqi_4MB-6VT}1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9GBe?o(duA$3f{}@T58S+} z7p;nCf)4vpa? zP&k>vOiX0nZ|3C-`d|)AxmL?St7=^*F#_^;QBry3U*I>H>BNzmZ;gmFFEinXK~~&W z2tCQigCHtB?S|hc^n=34_z~(t)N~r5J-u=a{D<^u8Io#`vi)u#iy@cn$K9RYr)m@C z*DX19U90LtLTbP7AAU~FW+{JC+48+=>h=_FZ%*GFBW*vRH9GhdTG^7JYM|A<6C2oY ze1a*oFoDK+3|g1#2V;2~SFjx~p!#NzEp$TL-7}txo?FHi1?l4BCu{b?43lm(PyRAZ z((croB(@IpbK7@+8X}T69-LV1~0Ra9B10~mP literal 0 HcmV?d00001 diff --git a/docs/pages/configuration.md b/docs/pages/configuration.md new file mode 100644 index 0000000..4628414 --- /dev/null +++ b/docs/pages/configuration.md @@ -0,0 +1,84 @@ +--- +title: Configuration +--- + +Pēji provide simple configuration file in YAML format. + +
+Config example... +```yaml +# Site title. +title: Pēji +# Site meta description. +description: Stupidly simple static site generator. +# Site default theme. +theme: default +# Site menu. +menu: + Home: / + Quickstart: /quickstart.html + Configuration: /configuration.html + Download: /download.html +# Markdown extensions. +# See https://python-markdown.github.io/extensions/ +markdown_extensions: + - admonition + - codehilite + - extra + - meta + - toc +markdown_extension_configs: + codehilite: + noclasses: true + use_pygments: true + pygments_style: default + toc: + title: Table of contents + toc_depth: 2-5 +``` +
+ +[TOC] + +## Title and description + +The **title** on each page looks like this: + +```jinja2 +# In browser: +page title | site title. +# In template (default layout): +{% block title %}{{ title }} | {{ site_title }}{% endblock %} +``` + +Of course, the view can be changed in the layout. Pēji will pass both values to the template. + +The *page* title is specified in the markdown file metadata (See: [Page metadata](/quickstart.html#page-metadata)). The *site* title is set in the `config.yaml`. If `title` is not specified, it will be accepted as an empty string. + +Site **description** in unused in default layout, but you can use it if you want. Also if `description` is not specified, it will be accepted as an empty string. + +## Themes + +A **theme** is just a collection of static JS, CSS, and images. Any code can be there, there are no restrictions. + +To make it easier to "switch themes", each theme is located in its own folder inside `themes/`, for example: + +``` +themes + ├── default + │ ├── css + │ ├── images + │ └── js + └── my_theme + ├── css + ├── images + └── js +``` + +In the standard layout theme is connected in the `index.j2`, but it can be set in a layout that is convenient for you. + +```jinja2 + +``` + +`config.yaml` sets the default theme, which is used if a page does not have a theme specified in the metadata. \ No newline at end of file diff --git a/docs/pages/downloads.md b/docs/pages/downloads.md new file mode 100644 index 0000000..739b106 --- /dev/null +++ b/docs/pages/downloads.md @@ -0,0 +1,18 @@ +--- +title: Downloads +--- + +# Downloads + +**Pēji 1.0** + +2021.04.12 + +- Source code: [Peji-1.0.tar.gz](Peji-1.0.tar.gz) + +--- + +Source code is also available in git repository: + +- [gitea.gch.icu](https://gitea.gch.icu/ge/peji){target="_blank"}. +- [mirror on GitHub](https://github.com/gechandesu/peji){target="_blank"}. diff --git a/docs/pages/index.md b/docs/pages/index.md new file mode 100644 index 0000000..81ce003 --- /dev/null +++ b/docs/pages/index.md @@ -0,0 +1,66 @@ +--- +title: Home +--- + +**Pēji** (Japanese: ページ, "page") is simple way to generate small static site like this site. + +If you need to collect several pages from the Markdown, then Pēji are great for you. + +!!! note "**Note**" + Pēji is not intended to generate a blog site. Its single pages only. You can link pages with hyper-links, but you have to do it manually. + +Features: + +- [Python-Markdown](https://python-markdown.github.io/){target="_blank"} is used. +- Code syntax highlighting via [Pygments](https://pygments.org/){target="_blank"}. +- [Jinja2](https://jinja.palletsprojects.com/en/2.11.x/){target="_blank"} template engine. +- Custom style and layout for specific page. +- Site menu bar can be edited through the config. +- YAML config file. + +## Installation and quickstart + +Install Pēji globally or into virtual environment: + +```bash +pip install Peji +``` + +Create your site: + +```bash +peji create mysite +cd mysite/ +``` + +Create your first page and place it into `mysite/pages/`: + +`index.md`: + +```markdown +--- +title: My first page +--- + +# My heading + +It works! +``` + +Build your site: + +``` +peji build +``` + +Site will be placed in `./mysite/build`. + +Also you can run Python built-in HTTP Server: + +```bash +python3 -m http.server --directory build/ +``` + +## License + +Pēji is released under The Unlicense. See [https://unlicense.org/](https://unlicense.org/){target="_blank"} for detais. \ No newline at end of file diff --git a/docs/pages/peji_jp_speech.mp3 b/docs/pages/peji_jp_speech.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..85e16ad95fdefbc8e95e4d0fe9ca6e06c0ac2516 GIT binary patch literal 3806 zcmcJS`8U+>`^R5nnHbX;48}foNs^uH`(Cz?%9b@sC|hs)GE>$PjjS_>AtXy8`#QA9 znw@N+$QEHeOKV;C-&*OlG#L8V0h(@MYp&`tqVz;tSY~=>763 z$_J)#o!!;6fPRg;uEm_^=BBQ%HEbSlfuJ-d#(i%9i@`sty7+8qf#Ai-?ay&m#yx?p z7m_Ucs>87-?=g-F$0{TwodNmg4Co@1lUOqaJ}rw*GQB-G_giB%+;8QI`@+YA%ihi1 zM@^?c9b3wXXIwAa*!zipd&gJ9Z{Msz;%~>tnU3b-Tf=U_8p0+eCdOqdD>6?uPP$hk zRUbVY=j*DlPq5+BI@a3S5a4Esef{0U(6eFZ8=fn` zl{TLciJ=dK1x4Px2?(t{& z^3|IA{Wl_Yb=%Pib=OC6-Gi*~D@h^KagPGtF#4@H#O}V=ZcdO$`%`aLYJYKrM` z7e6C19H!Y{>ZK(u?EE&zC>11p3G0k0vto+A0AWB@Y)IaTkugMVZ|fXcHVY9lL=j14 zzar3&va_jh{9<?PDe=mkFO2zV1qAtB)xp(eWL|e5f9p}6CG{8`58Y)!Fr-0 zfF7^ZNM?8mzXlF3C_~GJJEMy*;UN%NN{C?wvfn*lrt zzi>uz=c9;SuVKINegEx!iX#Z(MZpIeE{{1B!Ec%%<&L*XktGaj_$QKLrzgvGh7RKG zDwgpBJiQX?($nSx*Sh`LnI59)_*{yi8e{+0Zz^Q+P@eR9OOrER!BbPB9UkOZ8gzv! zoVdWiBH`Lsx|tm{^>TDfq7*35{6-_ac+fEqS*~yv(Ry$wuP35mSkf~NcFDDnQ-w;k z*B|PDN7*_U%NLbf`}I}e)~RYk=oiwS|AHxUTvqn&0a%s0ACkW42=B!ijkd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C?jbib> zs?$;!VJT8Ij;EDpD#^U;pHEQHQ5uMrnIp%%D9!{O?<#Fy>ov-IU;LRTVvD_E)pILS zz#}?vbQbX!>he0z+o+b62eY&N}rr{vWE7ro)dRUmeL zh1(N?(@3zkC)mJxZ4c>P{!YvbVJ~I1#w%Q9 z-8pY=oVr?}+B>iZz10~ApHCLFxax501A%m+AZnE~`P$0O&4DY1U}c?LLO3+};JbYH z+F#KUQqGffp?-}(EJ1>eZ(ay+_5n2!C9}+gqvlV-$*1C=}!js&#ddzS~Nn* z#w)eoC@ID`k)=Rz?uh*Qb*8C1hmQgW$=}vY+gx9c`iryup9R%&px6@oG!Qaq|3B;U H|110-rtcoT literal 0 HcmV?d00001 diff --git a/docs/pages/quickstart.md b/docs/pages/quickstart.md new file mode 100644 index 0000000..24b6922 --- /dev/null +++ b/docs/pages/quickstart.md @@ -0,0 +1,157 @@ +--- +title: Quickstart +--- + +# Quickstart + +[TOC] + +## Installation options + +### Via pip from PyPI + +Just run: + +```bash +pip install Peji +``` + +### Via setup.py + +You should already have the Python `setuptools` package installed. + +Clone repo: + +```bash +git clone https://gitea.gch.icu/ge/peji.git +cd peji/ +``` + +Run: + +```bash +pip install . +``` + +pip automatically runs `setup.py` and install all dependencies. + +## Command line interface + +Pēji provides small command line interface. + +App supports only two commands: + +`create SITE` +: Create new site in directory SITE. For example: + + ``` + peji create mysite + ``` + + In `mysite/` dir will be created standard file structure. See [Site structure](#site-structure) below. + +`build` +: Render HTML pages and place it with other static content into `mysite/build/` directory. + + You can choose specific directory instead of `build/` if pass `-d` (or `--dir`) option. For example, build site into `my_static_site/`: + + ``` + peji build -d my_static_site/ + ``` + +## Site structure + +After creating site you have this site structure: + +``` +mysite/ +├── config.yaml +├── layouts +│ ├── base.j2 +│ └── index.j2 +├── pages +└── themes + └── default + ├── css + │ └── main.css + ├── images + └── js +``` + +There is: + +config.yaml +: Site configuration file. See more [here](/configuration.html). + +layouts/ +: This folder contains Jinja2 templates. By default `base.j2` and `index.j2` is used. + +pages/ +: Place your markdown files here. + +themes/ +: Contains CSS, JS and images that need for page design. + +build/ +: Generated HTML files. Creates after running `peji build`. + +## Pages + +### Page metadata. + +Like many other static site generators and flat-file CMS, in Pēji metadata is required for Markdown files. + +Metadata must be appended to the beginning of the markdown file and is surrounded by a triple minus sign at the beginning and end. Data are presented in YAML format. Example: + +```yaml +--- +title: My page title +layout: index.j2 +theme: my_theme +--- + +# Your markdown text here +``` + +At the moment the application only supports these three properties. Consider each: + +title +: Page title. Is appended in HTML ``. + + Default: No default value. This property is required. + +layout +: You can set custom template for specific page. Template file must be placed into `layouts/` directory. + + Default: `index.j2` + +theme +: Custom theme (CSS) for page. By default themes are placed into `themes//`. In this property you only need to specify the ``, you don't need to specify the path. + + Default: `default` + +## Templates (Layouts) + +### Page variables + +Page variables are passed to Jinja2 templates. Below is a description of each variable. A colon separated from the name of a variable indicates its type (see [Python Data Types](https://www.w3schools.com/python/python_datatypes.asp){target="_blank"}, [[Docs]](https://docs.python.org/3/library/datatypes.html){target="_blank"}). + +theme: str +: Page theme. Can be specified in page metadata. Otherwise, the value from `config.yaml` is used. + +title: str +: Required property, set in the page metadata. + +site_title: str +: Site title. Optional, set in `config.yaml` (named `title`). See [Configuration](/configuration.html#title-and-description). + +description: str +: See. [Configuration](/configuration.html#title-and-description). + +menu: dict +: Contains a dictionary where the key is the title of the link and the key value is the URL of the link. The data is filled from `config.yaml`'s `menu`. + +content: str +: This is a string containing HTML-converted Markdown text. In the template, this variable must be used with `safe` to avoid escaping HTML tags. Usage example: + + `{{ content | safe }}` diff --git a/docs/themes/default/css/main.css b/docs/themes/default/css/main.css new file mode 100644 index 0000000..55c2df6 --- /dev/null +++ b/docs/themes/default/css/main.css @@ -0,0 +1,103 @@ +body { + margin: 32px; + font-size: 16px; + color: #000000; + background-color: #ffffff; +} + +hr { + border: none; + border-top: 0.5px solid; +} + +a, +a:active, +a:visited { + color: #3f37c9; + text-decoration: none; +} + +a:hover { + border-bottom: 1px dashed; +} + + +.menu { + margin: 18px 0 28px 0; +} + +.menu ul { + padding: 0; +} + +.menu ul li { + margin: 0; + padding: 0; + padding-right: 8px; + display: inline-block; + list-style: none; +} + +.menu ul li::before { + content: '|'; + position: relative; + left: -6px; +} + +.menu ul li:first-child::before { + content: none; +} + +pre { + padding: 12px; + overflow: auto; +} + +dt { + font-weight: bold; + font-style: italic; +} + +dd { + margin-top: 8px; + margin-bottom: 12px; +} + +details summary { + cursor: pointer; + margin-bottom: 16px; +} + +.admonition { + padding: 0 16px; +} + +.info { + color: #055160; + background-color: #cff4fc; + border: 1px solid #055160; +} + +.note { + color: #084298; + background-color: #cfe2ff; + border: 1px solid #084298; +} + +.tip { + color: #0f5132; + background-color: #d1e7dd; + border: 1px solid #0f5132; +} + +.warning { + color: #664d03; + background-color: #fff3cd; + border: 1px solid #664d03; +} + +.danger { + color: #842029; + background-color: #f8d7da; + border: 1px solid #842029; +} \ No newline at end of file diff --git a/docs/themes/default/images/favicon.ico b/docs/themes/default/images/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..da6bb8345e6d4db39ec3045c77657dae42617168 GIT binary patch literal 1150 zcmZQzU<5(|0R|wcz>vYhz#zuJz@P!dKp~(AL>x#lFaYI*xgi+LAD%=3&|3{iIGz-5 zT3cJ6pDzyBY|OaSpo1=P?FbAMi5-u=+f z(EUI+I1uX&B>UIP$jD5XIdkTFP*?!<2M}WhlKup!`UFsTxVgCz6_!}^2b@2Do>=_` z`uh6oq2WIPXuks}PCoW0LXPf t!vd&E1`qE)FjissLp=in2>$?zfw4T0<_BV+&q4SDko^HD_Q4*Z2LOc%e9iy> literal 0 HcmV?d00001