Skip to content

Commit a365a01

Browse files
committed
Update docs with new examples
1 parent 5d8c4b9 commit a365a01

File tree

1 file changed

+27
-98
lines changed

1 file changed

+27
-98
lines changed

docs/examples.rst

Lines changed: 27 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,132 +1,61 @@
11
Examples
22
========
33

4-
Examples are available in the `genja <https://github.com/wigging/genja>`_ repository on GitHub. See the sections below for more information about each example.
5-
6-
Building the examples
7-
---------------------
8-
9-
The examples are located in the **genja/examples** directory in the GitHub repository. Use the ``genja build`` or ``genja serve`` command to generate the HTML for a particular example. For instance, use the commands shown below to build the website and run a local server for the **directory-nocat** example. The example website will automatically reload in the web browser when changes are saved to the Markdown files.
4+
Examples are available in the **genja/examples** directory in the genja `GitHub <https://github.com/wigging/genja>`_ repository. Use the ``genja build`` or ``genja serve`` command to generate the HTML for a particular example. For instance, use the command shown below to build the website and run a local server for the **directory-output** example. The website will automatically reload in the web browser when changes are saved to the Markdown files.
105

116
.. code:: text
127
13-
cd examples/directory-nocat
8+
cd examples/directory-output
149
genja serve
1510
16-
Use the commands shown below to build the example website without starting a local server.
11+
Alternatively, use the build command to build the website without starting a local server.
1712

1813
.. code:: text
1914
20-
cd examples/directory-nocat
15+
cd examples/directory-output
2116
genja build
2217
23-
Directory output with no categories
24-
-----------------------------------
18+
Code blocks
19+
-----------
2520

26-
The **directory-nocat** example uses the **mysite** directory for the generated HTML output. The Markdown files are located in the **_pages** and **_posts** directories. The Markdown files are not organized into categories using sub-directories. The **_templates** directory contains the Jinja templates.
21+
The code-blocks example demonstrates the use of `highlight.js <https://highlightjs.org>`_ to provide syntax coloring of code that is rendered in pages and posts.
2722

28-
.. code:: text
23+
Directory output
24+
----------------
2925

30-
directory-nocat/
31-
├── mysite/
32-
│ ├── img/
33-
│ └── styles.css
34-
├── _pages/
35-
│ ├── about.md
36-
│ └── contact.md
37-
├── _posts/
38-
│ ├── apple.md
39-
│ └── orange.md
40-
├── _templates/
41-
│ ├── index.html
42-
│ ├── page.html
43-
│ └── post.html
44-
└── genja.toml
45-
46-
Directory output with categories
47-
--------------------------------
48-
49-
The **directory-withcat** example uses the **mysite** directory for the generated HTML output. The Markdown files are located in the **_pages** and **_posts** directories. The Markdown files are organized into categories using sub-directories. The **_templates** directory contains the Jinja templates.
26+
The directory-output example defines ``site_output = "mysite"`` in the ``genja.toml`` file. This tells Genja to output the generated content to the ``mysite`` directory in the project.
5027

5128
.. code:: text
5229
53-
directory-withcat/
54-
├── mysite/
55-
│ ├── img/
56-
│ └── styles.css
30+
directory-output/
5731
├── _pages/
58-
│ ├── about.md
59-
│ └── contact.md
6032
├── _posts/
61-
│ ├── fruits/
62-
│ └── veggies/
6333
├── _templates/
64-
│ ├── index.html
65-
│ ├── page.html
66-
│ └── post.html
34+
├── mysite/ <-- output from Genja will go in this directory
6735
└── genja.toml
6836
69-
Top-level output with no categories
70-
-----------------------------------
37+
HTML content
38+
------------
7139

72-
The **toplevel-nocat** example uses the root directory for the generated HTML output. The Markdown files are located in the **_pages** and **_posts** directories. The Markdown files are not organized into categories using sub-directories. The **_templates** directory contains the Jinja templates.
40+
The ``html-content`` example demonstrates putting HTML in the Markdown file.
7341

74-
.. code:: text
42+
Image files
43+
-----------
7544

76-
toplevel-nocat/
77-
├── img/
78-
│ └── apple.jpg
79-
├── _pages/
80-
│ ├── about.md
81-
│ └── contact.md
82-
├── _posts/
83-
│ ├── apple.md
84-
│ └── orange.md
85-
├── _templates/
86-
│ ├── index.html
87-
│ ├── page.html
88-
│ └── post.html
89-
├── genja.toml
90-
└── styles.css
45+
The ``image-files`` example shows how to embed images in the Markdown file.
9146

92-
Top-level output with no pages
93-
------------------------------
47+
Pages and posts
48+
---------------
9449

95-
The **toplevel-nopages** example uses the root directory for the generated HTML output. The Markdown files are located in the **_posts** directory, there is no **_pages** directory for this example. The Markdown files are not organized into categories using sub-directories. The **_templates** directory contains the Jinja templates.
50+
The ``pages-and-posts`` examples demonstrates creating pages and posts as Markdown files.
9651

97-
.. code:: text
98-
99-
toplevel-nopages/
100-
├── img/
101-
│ └── apple.jpg
102-
├── _posts/
103-
│ ├── apple.md
104-
│ └── orange.md
105-
├── _templates/
106-
│ ├── index.html
107-
│ └── post.html
108-
├── genja.toml
109-
└── styles.css
52+
Root output
53+
-----------
11054

111-
Top-level output with categories
112-
--------------------------------
55+
The ``root-output`` example generates the HTML website content at the root level of the project.
11356

114-
The **toplevel-withcat** example uses the root directory for the generated HTML output. The Markdown files are located in the **_pages** and **_posts** directories. The Markdown files are organized into categories using sub-directories. The **_templates** directory contains the Jinja templates.
57+
Sort posts
58+
----------
11559

116-
.. code:: text
60+
The ``sort-posts`` example sorts the posts.
11761

118-
toplevel-withcat/
119-
├── img/
120-
│ └── apple.jpg
121-
├── _pages/
122-
│ ├── about.md
123-
│ └── contact.md
124-
├── _posts/
125-
│ ├── fruits/
126-
│ └── veggies/
127-
├── _templates/
128-
│ ├── index.html
129-
│ ├── page.html
130-
│ └── post.html
131-
├── genja.toml
132-
└── styles.css

0 commit comments

Comments
 (0)