From 78c3dc973795cbb6fc696b0196bf917000b03117 Mon Sep 17 00:00:00 2001 From: randogoth Date: Tue, 16 May 2023 23:34:27 +0300 Subject: [PATCH] init --- .../__pycache__/pelicanconf.cpython-310.pyc | Bin 0 -> 567 bytes example/content/concepts.md | 57 +++ example/content/intro.md | 13 + example/content/markup.md | 121 +++++++ example/output/micron/archives.mu | 48 +++ example/output/micron/author/node-nomad.mu | 50 +++ example/output/micron/authors.mu | 6 + example/output/micron/categories.mu | 5 + example/output/micron/category/misc.mu | 49 +++ .../output/micron/concepts-and-terminology.mu | 67 ++++ example/output/micron/index.mu | 48 +++ example/output/micron/introduction.mu | 23 ++ example/output/micron/markup.mu | 137 ++++++++ example/output/micron/tags.mu | 4 + example/pelicanconf.py | 27 ++ example/publishconf.py | 21 ++ plugin/micron/__init__.py | 1 + .../__pycache__/__init__.cpython-310.pyc | Bin 0 -> 173 bytes .../micron/__pycache__/micron.cpython-310.pyc | Bin 0 -> 11110 bytes plugin/micron/micron.py | 324 ++++++++++++++++++ theme/README.md | 0 theme/templates/404.mu | 1 + theme/templates/archives.mu | 1 + theme/templates/article.mu | 17 + theme/templates/author.mu | 6 + theme/templates/authors.mu | 9 + theme/templates/base.mu | 26 ++ theme/templates/categories.mu | 6 + theme/templates/category.mu | 5 + theme/templates/index.mu | 17 + theme/templates/page.mu | 8 + theme/templates/pagination.mu | 5 + theme/templates/period_archives.mu | 10 + theme/templates/tag.mu | 0 theme/templates/tags.mu | 6 + theme/templates/translations.mu | 8 + 36 files changed, 1126 insertions(+) create mode 100644 example/__pycache__/pelicanconf.cpython-310.pyc create mode 100644 example/content/concepts.md create mode 100644 example/content/intro.md create mode 100644 example/content/markup.md create mode 100644 example/output/micron/archives.mu create mode 100644 example/output/micron/author/node-nomad.mu create mode 100644 example/output/micron/authors.mu create mode 100644 example/output/micron/categories.mu create mode 100644 example/output/micron/category/misc.mu create mode 100644 example/output/micron/concepts-and-terminology.mu create mode 100644 example/output/micron/index.mu create mode 100644 example/output/micron/introduction.mu create mode 100644 example/output/micron/markup.mu create mode 100644 example/output/micron/tags.mu create mode 100644 example/pelicanconf.py create mode 100644 example/publishconf.py create mode 100644 plugin/micron/__init__.py create mode 100644 plugin/micron/__pycache__/__init__.cpython-310.pyc create mode 100644 plugin/micron/__pycache__/micron.cpython-310.pyc create mode 100644 plugin/micron/micron.py create mode 100644 theme/README.md create mode 100644 theme/templates/404.mu create mode 100644 theme/templates/archives.mu create mode 100644 theme/templates/article.mu create mode 100644 theme/templates/author.mu create mode 100644 theme/templates/authors.mu create mode 100644 theme/templates/base.mu create mode 100644 theme/templates/categories.mu create mode 100644 theme/templates/category.mu create mode 100644 theme/templates/index.mu create mode 100644 theme/templates/page.mu create mode 100644 theme/templates/pagination.mu create mode 100644 theme/templates/period_archives.mu create mode 100644 theme/templates/tag.mu create mode 100644 theme/templates/tags.mu create mode 100644 theme/templates/translations.mu diff --git a/example/__pycache__/pelicanconf.cpython-310.pyc b/example/__pycache__/pelicanconf.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c62995b0518f8fda42e179df74d21459acc0672d GIT binary patch literal 567 zcmd1j<>g{vU|_I&n4F@{#K7fDQr<3DQr=kDQr<(DeO_)DI8HeDV*tyQM@T!>5Nf)Dcn)~ zDLhdEDQv+En!Ht9e)%b>3V!*yi78dwzM08I`FRRXIr-_g7;dpA=jWBA=9S!H4h?a> z#gv-o=N3}Msi&u3kW-qTnRkmV7p%OBLr+h?BqKF9wTd^tw4|W4L?0rdDR_&`F*L-( zKj;=muxE&?pQEqqEp`wqG|1-`OMqjD$1RQ!PhZz4e?Qk-JT9(oj-fsw@ji}z?zec| zTwPt_9esS_9Yg$mZwWa&hPb->2Svt1#6e=BAwiCQ!9I>5p8kGF!U7O0kwo~BMS_BZ zZwbMy3UGAy^aC4ki#Ny>WK@`Id}xqQ@GYJIpHO#Czj%-%gKx1zc)_<=Lp)r4U2k#w zdO8RBLu6Mn6p1r1K!{&v`WgATsrqR-r4{-CMfq8&$tA_m(9liF$xqi$tw_u*$Vt^N zNX^MiPRvWr&r8!QsJz8tlbfGXnv-e=it1t|1_lNe1{OvZMiwS8WCpV#d}cOgHbxdk G4n_dlj+^NK literal 0 HcmV?d00001 diff --git a/example/content/concepts.md b/example/content/concepts.md new file mode 100644 index 0000000..9ca248f --- /dev/null +++ b/example/content/concepts.md @@ -0,0 +1,57 @@ +Title: Concepts and Terminology +Date: 2023-05-16 + +# Concepts and Terminology + +The following section will briefly introduce various concepts and terms used in the program. + +## Peer + +A *peer* refers to another Nomad Network client, which will generally be operated by another person. But since Nomad Network is a general LXMF client, it could also be any other LXMF client, program, automated system or machine that can communicate over LXMF. + +All peers (and nodes) are identified by their *address* (which is, technically speaking, a Reticulum destination hash). An address consist of 32 hexadecimal characters (16 bytes), and looks like this: + +` Wait! It's worth noting that we can also create sections without headings. They look like this. + +#Links + +Links to pages, files or other resources can be created with the `[` tag, which should always be terminated with a closing `]`. You can create links with and without labels, it is up to you to control the formatting of links with other tags. Although not strictly necessary, it is good practice to at least format links with underlining. + +Here's a few examples: + +``` +Here is a link without any label: [72914442a3689add83a09a767963f57c:/page/index.mu] + +This is a [labeled link](72914442a3689add83a09a767963f57c:/page/index.mu) to the same page, but it's hard to see if you don't know it +``` + +The above markup produces the following output: + +Here is a link without any label: [72914442a3689add83a09a767963f57c:/page/index.mu] + +This is a [labeled link](72914442a3689add83a09a767963f57c:/page/index.mu) to the same page, but it's hard to see if you don't know it + +--- + +When links like these are displayed in the built-in browser, clicking on them or activating them using the keyboard will cause the browser to load the specified URL. + +#Literals + +To display literal content, for example source-code, or blocks of text that should not be interpreted by micron, you can use literal blocks, specified by the ``` tag. \ No newline at end of file diff --git a/example/output/micron/archives.mu b/example/output/micron/archives.mu new file mode 100644 index 0000000..002eba3 --- /dev/null +++ b/example/output/micron/archives.mu @@ -0,0 +1,48 @@ +`# lang: en +>Micron Blog + + + ++[Tue 16 May 2023] +>>>>`[`!Concepts and Terminology`!`/concepts-and-terminology.html] +>>>>> Concepts and Terminology + +The following section will briefly introduce various concepts and terms used in the program. + +>> Peer + +A `*peer`* refers to another Nomad Network client, which will generally be operated by another person. But since Nomad Network is a general LXMF client, it could also be any other LXMF … + +- + + ++[Tue 16 May 2023] +>>>>`[`!Introduction`!`/introduction.html] +>>>>>> Communicate Freely. + +The intention with this program is to provide a tool to that allows you to build private and resilient communications platforms that are in complete control and ownership of the people that use them. + +Nomad Network is build on LXMF and Reticulum, which together provides the cryptographic mesh … + +- + + ++[Tue 16 May 2023] +>>>>`[`!Markup`!`/markup.html] +>>>>> Outputting Formatted Text + +- + +`!Hello!`! This is output from `*micron`* +Micron generates formatted text for your terminal + +- + +Nomad Network supports a simple and functional markup language called `*micron`*. If you are familiar with `*markdown`* or `*HTML`*, you will feel right at home writing pages with micron. + +With micron you can easily … + +- + + + diff --git a/example/output/micron/author/node-nomad.mu b/example/output/micron/author/node-nomad.mu new file mode 100644 index 0000000..f78fb3a --- /dev/null +++ b/example/output/micron/author/node-nomad.mu @@ -0,0 +1,50 @@ +`# lang: en +>Micron Blog + +>>Articles by Node Nomad + + + ++[Tue 16 May 2023] +>>>>`[`!Concepts and Terminology`!`/concepts-and-terminology.html] +>>>>> Concepts and Terminology + +The following section will briefly introduce various concepts and terms used in the program. + +>> Peer + +A `*peer`* refers to another Nomad Network client, which will generally be operated by another person. But since Nomad Network is a general LXMF client, it could also be any other LXMF … + +- + + ++[Tue 16 May 2023] +>>>>`[`!Introduction`!`/introduction.html] +>>>>>> Communicate Freely. + +The intention with this program is to provide a tool to that allows you to build private and resilient communications platforms that are in complete control and ownership of the people that use them. + +Nomad Network is build on LXMF and Reticulum, which together provides the cryptographic mesh … + +- + + ++[Tue 16 May 2023] +>>>>`[`!Markup`!`/markup.html] +>>>>> Outputting Formatted Text + +- + +`!Hello!`! This is output from `*micron`* +Micron generates formatted text for your terminal + +- + +Nomad Network supports a simple and functional markup language called `*micron`*. If you are familiar with `*markdown`* or `*HTML`*, you will feel right at home writing pages with micron. + +With micron you can easily … + +- + + + diff --git a/example/output/micron/authors.mu b/example/output/micron/authors.mu new file mode 100644 index 0000000..87281be --- /dev/null +++ b/example/output/micron/authors.mu @@ -0,0 +1,6 @@ +`# lang: en +>Micron Blog + +>Authors on Micron Blog+ `[Node Nomad`/author/node-nomad.html] (3) + + diff --git a/example/output/micron/categories.mu b/example/output/micron/categories.mu new file mode 100644 index 0000000..1e28f4e --- /dev/null +++ b/example/output/micron/categories.mu @@ -0,0 +1,5 @@ +`# lang: en +>Micron Blog + ++ `[misc`/category/misc.html] + diff --git a/example/output/micron/category/misc.mu b/example/output/micron/category/misc.mu new file mode 100644 index 0000000..d28ef25 --- /dev/null +++ b/example/output/micron/category/misc.mu @@ -0,0 +1,49 @@ +`# lang: en +>Micron Blog + +>>misc + + ++[Tue 16 May 2023] +>>>>`[`!Concepts and Terminology`!`/concepts-and-terminology.html] +>>>>> Concepts and Terminology + +The following section will briefly introduce various concepts and terms used in the program. + +>> Peer + +A `*peer`* refers to another Nomad Network client, which will generally be operated by another person. But since Nomad Network is a general LXMF client, it could also be any other LXMF … + +- + + ++[Tue 16 May 2023] +>>>>`[`!Introduction`!`/introduction.html] +>>>>>> Communicate Freely. + +The intention with this program is to provide a tool to that allows you to build private and resilient communications platforms that are in complete control and ownership of the people that use them. + +Nomad Network is build on LXMF and Reticulum, which together provides the cryptographic mesh … + +- + + ++[Tue 16 May 2023] +>>>>`[`!Markup`!`/markup.html] +>>>>> Outputting Formatted Text + +- + +`!Hello!`! This is output from `*micron`* +Micron generates formatted text for your terminal + +- + +Nomad Network supports a simple and functional markup language called `*micron`*. If you are familiar with `*markdown`* or `*HTML`*, you will feel right at home writing pages with micron. + +With micron you can easily … + +- + + + diff --git a/example/output/micron/concepts-and-terminology.mu b/example/output/micron/concepts-and-terminology.mu new file mode 100644 index 0000000..9a9d0cd --- /dev/null +++ b/example/output/micron/concepts-and-terminology.mu @@ -0,0 +1,67 @@ +`# lang: en +>Micron Blog + + +>Concepts and Terminology + + +Tue 16 May 2023 + +by Node Nomad + +> Concepts and Terminology + +The following section will briefly introduce various concepts and terms used in the program. + +>> Peer + +A `*peer`* refers to another Nomad Network client, which will generally be operated by another person. But since Nomad Network is a general LXMF client, it could also be any other LXMF client, program, automated system or machine that can communicate over LXMF. + +All peers (and nodes) are identified by their `*address`* (which is, technically speaking, a Reticulum destination hash). An address consist of 32 hexadecimal characters (16 bytes), and looks like this: + +`=<e9eafceea9e3664a5c55611c5e8c420a# `= + +Anyone can choose whatever display name they want, but addresses are always unique, and generated from the unique cryptographic keys of the peer. This is an important point to understand. Since there is not anyone controlling naming or address spaces in Nomad Network, you can easily come across another user with the same display name as you. + +Your addresses will always be unique though, and you must always verify that the address you are communicating with is matching the address of the peer you expect to be in the other end. + +To make this easier, Nomad Network allows you to mark peers and nodes as either `*trusted`*, `*unknown`* or `*untrusted`*. In this way, you can mark the peers and nodes that you know to be legitimate, and easily spot peers with similar names as unrelated. + +>> Announces + +An `*announce`* can be sent by any peer or node on the network, which will notify other peers of its existence, and contains the cryptographic keys that allows other peers to communicate with it. + +In the `![ Network ]`! section of the program, you can monitor announces on the network, initiate conversations with announced peers, and announce your own peer on the network. You can also connect to nodes on the network and browse information shared by them. + +>> Conversations + +Nomad Network uses the term `*conversation`* to signify both direct peer-to-peer messaging threads, and also discussion threads with an arbitrary number of participants that might change over time. + +Both things like discussion forums and chat threads can be encapsulated as conversations in Nomad Network. The user interface will indicate the different characteristics a conversation can take, and also what form of transport encryption was used for messages within. + +In the `![ Conversations ]`! part of the program you can view and interact with all currently active conversations. You can also edit nickname and trust settings for peers belonging to these conversations here. To edit settings for a peer, select it in the conversation list, and press `!Ctrl-E`!. + +By default, Nomad Network will attempt to deliver messages to a peer directly. This happens by first establishing an encrypted link directly to the peer, and then delivering the message over it. + +If the desired peer is not available because it has disconnected from the network, this method will obviously fail. In this case, Nomad Network will attempt to deliver the message to a node, which will store and forward it over the network, for later retrieval by the destination peer. The message is encrypted before being transmitted to the network, and is only readable by the intended recipient. + +For propagated delivery to work, one or more nodes must be available on the network. If one or more trusted nodes are available, Nomad Network will automatically select the most suitable node to send the message via, but you can also manually specify what node to use. + +To select a node manually, go to the `![ Network ]`! part of the program, choose the desired node in the `*Known Nodes`* list, and select the `!< Info # ** button. In the **Node Info`! dialog, you can specify the selected node as the default propagation node. + +By default, Nomad Network will check in with propagation nodes, and download any available messages every 6 hours. You can change this interval, or disable automatic syncronisation completely, by editing the configuration file. + +You can always initiate a sync manually, by pressing `!Ctrl-R`! in the `![ Conversations ]`! part of the program, which will open the syncronisation window. + +>> Node + +A Nomad Network `*node`* is an instance of the Nomad Network program that has been configured to host information for other peers and help propagate messages and information on the network. + +Nodes can host pages (similar to webpages) written in a markup-language called `*micron`*, as well as make files and other resources available for download for peers on the network. Nodes also form a distributed message store for offline users, and allows messages to be exchanged between peers that are not online at the same time. + +If no nodes exist on a network, all peers will still be able to communicate directly peer-to-peer, but both endpoints of a conversation will need to be available at the same time to converse. When nodes exist on the network, messages will be held and syncronised between nodes for deferred delivery if the destination peer is unavailable. Nodes will automatically discover and peer with each other, and handle syncronisation of message stores. + +To learn how to host your own node, read the `*Hosting a Node`* section of this guide. + + + diff --git a/example/output/micron/index.mu b/example/output/micron/index.mu new file mode 100644 index 0000000..002eba3 --- /dev/null +++ b/example/output/micron/index.mu @@ -0,0 +1,48 @@ +`# lang: en +>Micron Blog + + + ++[Tue 16 May 2023] +>>>>`[`!Concepts and Terminology`!`/concepts-and-terminology.html] +>>>>> Concepts and Terminology + +The following section will briefly introduce various concepts and terms used in the program. + +>> Peer + +A `*peer`* refers to another Nomad Network client, which will generally be operated by another person. But since Nomad Network is a general LXMF client, it could also be any other LXMF … + +- + + ++[Tue 16 May 2023] +>>>>`[`!Introduction`!`/introduction.html] +>>>>>> Communicate Freely. + +The intention with this program is to provide a tool to that allows you to build private and resilient communications platforms that are in complete control and ownership of the people that use them. + +Nomad Network is build on LXMF and Reticulum, which together provides the cryptographic mesh … + +- + + ++[Tue 16 May 2023] +>>>>`[`!Markup`!`/markup.html] +>>>>> Outputting Formatted Text + +- + +`!Hello!`! This is output from `*micron`* +Micron generates formatted text for your terminal + +- + +Nomad Network supports a simple and functional markup language called `*micron`*. If you are familiar with `*markdown`* or `*HTML`*, you will feel right at home writing pages with micron. + +With micron you can easily … + +- + + + diff --git a/example/output/micron/introduction.mu b/example/output/micron/introduction.mu new file mode 100644 index 0000000..e0276e3 --- /dev/null +++ b/example/output/micron/introduction.mu @@ -0,0 +1,23 @@ +`# lang: en +>Micron Blog + + +>Introduction + + +Tue 16 May 2023 + +by Node Nomad + +>> Communicate Freely. + +The intention with this program is to provide a tool to that allows you to build private and resilient communications platforms that are in complete control and ownership of the people that use them. + +Nomad Network is build on LXMF and Reticulum, which together provides the cryptographic mesh functionality and peer-to-peer message routing that Nomad Network relies on. This foundation also makes it possible to use the program over a very wide variety of communication mediums, from packet radio to fiber. + +Nomad Network does not need any connections to the public internet to work. In fact, it doesn't even need an IP or Ethernet network. You can use it entirely over packet radio, LoRa or even serial lines. But if you wish, you can bridge islanded Reticulum networks over the Internet or private ethernet networks, or you can build networks running completely over the Internet. The choice is yours. + +The current version of the program should be considered a beta release. The program works well, but there will most probably be bugs and possibly sub-optimal performance in some scenarios. On the other hand, this is the best time to have an influence on the direction of the development of Nomad Network. To do so, join the discussion on the Nomad Network project on GitHub. + + + diff --git a/example/output/micron/markup.mu b/example/output/micron/markup.mu new file mode 100644 index 0000000..e643448 --- /dev/null +++ b/example/output/micron/markup.mu @@ -0,0 +1,137 @@ +`# lang: en +>Micron Blog + + +>Markup + + +Tue 16 May 2023 + +by Node Nomad + +> Outputting Formatted Text + +- + +`!Hello!`! This is output from `*micron`* +Micron generates formatted text for your terminal + +- + +Nomad Network supports a simple and functional markup language called `*micron`*. If you are familiar with `*markdown`* or `*HTML`*, you will feel right at home writing pages with micron. + +With micron you can easily create structured documents and pages with formatting, colors, glyphs and icons, ideal for display in terminals. + +##Recommendations and Requirements + +While micron can output formatted text to even the most basic terminal, there's a few capabilities your terminal `*must`* support to display micron output correctly, and some that, while not strictly necessary, make the experience a lot better. + +Formatting such as `_underline`_, `!bold`! or `*italics`* will be displayed if your terminal supports it. + +If you are having trouble getting micron output to display correctly, try using `*gnome-terminal`* or `*alacritty`*, which should work with all formatting options out of the box. Most other terminals will work fine as well, but you might have to change some settings to get certain formatting to display correctly. + +###Encoding + +All micron sources are intepreted as UTF-8, and micron assumes it can output UTF-8 characters to the terminal. If your terminal does not support UTF-8, output will be faulty. + +###Colors + +Shading and coloring text and backgrounds is integral to micron output, and while micron will attempt to gracefully degrade output even to 1-bit terminals, you will get the best output with terminals supporting at least 256 colors. True-color support is recommended. + +###Terminal Font + +While any unicode capable font can be used with micron, it's highly recommended to use a `*"Nerd Font"`* (see https://www.nerdfonts.com/), which will add a lot of extra glyphs and icons to your output. + +If you want to make a break, horizontal dividers can be inserted. They can be plain, like the one below this text, or you can style them with unicode characters and glyphs, like the wavy divider in the beginning of this document. + +- + +Text can be `_underlined`_, `!bold`! or `*italic`*. + +###Sections and Headings + +You can define an arbitrary number of sections and sub sections, each with their own named headings. Text inside sections will be automatically indented. + +- + +If you place a divider inside a section, it will adhere to the section indents. + +>>> + +If no heading text is defined, the section will appear as a sub-section without a header. This can be useful for creating indented blocks of text, like this one. + +> Micron tags + +Tags are used to format text with micron. Some tags can appear anywhere in text, and some must appear at the beginning of a line. If you need to write text that contains a sequence that would be interpreted as a tag, you can escape it with the character \. + +##Formatting + +Text can be formatted as `!bold`! by using the `=**`= tag, `_underline`_ by using the `=_`= tag and `*italic`* by using the `=*`= tag. + +##Sections + +To create sections and subsections, use the # tag. This tag must be placed at the beginning of a line. To specify a sub-section of any level, use any number of # tags. If text is placed after a # tag, it will be used as a heading. + +Here is an example of sections: + +`= +# High Level Stuff +This is a section. It contains this text. + +## Another Level +This is a sub section. + +### Going deeper +A sub sub section. We could continue, but you get the point. + +#### +Wait! It's worth noting that we can also create sections without headings. They look like this. + +`= + +The above markup produces the following output: + +> High Level Stuff + +This is a section. It contains this text. + +>> Another Level + +This is a sub section. + +>>> Going deeper + +A sub sub section. We could continue, but you get the point. + +>>>>Wait! It's worth noting that we can also create sections without headings. They look like this. + + + +#Links + +Links to pages, files or other resources can be created with the `=[`= tag, which should always be terminated with a closing `=]`=. You can create links with and without labels, it is up to you to control the formatting of links with other tags. Although not strictly necessary, it is good practice to at least format links with underlining. + +Here's a few examples: + +`= +Here is a link without any label: [72914442a3689add83a09a767963f57c:/page/index.mu] + +This is a [labeled link](72914442a3689add83a09a767963f57c:/page/index.mu) to the same page, but it's hard to see if you don't know it +`= + +The above markup produces the following output: + +Here is a link without any label: [72914442a3689add83a09a767963f57c:/page/index.mu] + +This is a `[labeled link`72914442a3689add83a09a767963f57c:/page/index.mu] to the same page, but it's hard to see if you don't know it + +- + +When links like these are displayed in the built-in browser, clicking on them or activating them using the keyboard will cause the browser to load the specified URL. + +#Literals + +To display literal content, for example source-code, or blocks of text that should not be interpreted by micron, you can use literal blocks, specified by the ``` tag. + + + diff --git a/example/output/micron/tags.mu b/example/output/micron/tags.mu new file mode 100644 index 0000000..be5bd8e --- /dev/null +++ b/example/output/micron/tags.mu @@ -0,0 +1,4 @@ +`# lang: en +>Micron Blog + + diff --git a/example/pelicanconf.py b/example/pelicanconf.py new file mode 100644 index 0000000..763f3c2 --- /dev/null +++ b/example/pelicanconf.py @@ -0,0 +1,27 @@ +AUTHOR = 'Node Nomad' +SITENAME = 'Micron Blog' +SITEURL = '' + +PATH = 'content' + +TIMEZONE = 'UTC' + +DEFAULT_LANG = 'en' + +# Feed generation is usually not desired when developing +FEED_ALL_ATOM = None +CATEGORY_FEED_ATOM = None +TRANSLATION_FEED_ATOM = None +AUTHOR_FEED_ATOM = None +AUTHOR_FEED_RSS = None + +DEFAULT_PAGINATION = False + +# Uncomment following line if you want document-relative URLs when developing +RELATIVE_URLS = True + +# Micron related settings +PLUGIN_PATHS = ["../plugin"] +PLUGINS = ['micron'] +THEME = '../theme' +MICRON_PATH = 'output/micron' \ No newline at end of file diff --git a/example/publishconf.py b/example/publishconf.py new file mode 100644 index 0000000..be3909b --- /dev/null +++ b/example/publishconf.py @@ -0,0 +1,21 @@ +# This file is only used if you use `make publish` or +# explicitly specify it as your config file. + +import os +import sys +sys.path.append(os.curdir) +from pelicanconf import * + +# If your site is available via HTTPS, make sure SITEURL begins with https:// +SITEURL = '' +RELATIVE_URLS = False + +FEED_ALL_ATOM = 'feeds/all.atom.xml' +CATEGORY_FEED_ATOM = 'feeds/{slug}.atom.xml' + +DELETE_OUTPUT_DIRECTORY = True + +# Following items are often useful when publishing + +#DISQUS_SITENAME = "" +#GOOGLE_ANALYTICS = "" \ No newline at end of file diff --git a/plugin/micron/__init__.py b/plugin/micron/__init__.py new file mode 100644 index 0000000..5e48b24 --- /dev/null +++ b/plugin/micron/__init__.py @@ -0,0 +1 @@ +from .micron import * \ No newline at end of file diff --git a/plugin/micron/__pycache__/__init__.cpython-310.pyc b/plugin/micron/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bb6a21755d57643a0aad3df3e2a74e1cd86a458c GIT binary patch literal 173 zcmd1j<>g{vU|^8Dmz*NXz`*br#6iYP3=9ko3=9m#JPZsBDGVu$ISe5TDNMl(n#?a5 z85kHe8E-La`DrrVV$01;F3Qha$xy_?zyKkBS?Xux=cekX<&;+F2NdOJr6!jY>qFG( vCgtR(>lfsdrf23sh4ka&GxIV_;^XxSDsOSvg{vU|^8Dmz?rcpMl{qh=Yt-85kHG7#J9eGZ+~dQW#Pga~Pr^G-DKF3PTE0 z4pT036f+}8j5&uTmodyZhPP?S)vaFlSaNR&vfXp|^eoFhjpS3F7_%;wCI$d!ze1hctv zq;jRBq`_?N9GP6%C|NL@Cr2(2s$A!Ca09OfwX6p>VoG^P~M6tNbTD9sd+RIN0o6!8>^7M3V&C{Hp) zs)Z#=$DJWXIz^_1Aw?!tzL_~n*PS6nHbt(5Aw@2gvza+c&z&JfK1HF0Aw?mTwV63e zKSeP`sf8iRAVoPv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HqdZY~ue2Jk^~S#*Mdfk77JO;8SIV_;+A z`^Ut{@gLlGDQaV2V0Z}%$toVzVvre-KfhR0Yx$_J40N@UX)splbD=Z1S(1)j^6$w?stN$02dJlKx#M(AS;hjQ*QCXoEHx+wfJF$UOc2F0SP`(wkg^JGUE_PI~P=Y zeo^r)4p2zP=auGymO+4*Go_})LpsNhBnPuAzvvck0dmk4T>+WJ2@gDQMubEyD^iv{ z4YC$ouz_O|6p6RE5M|R7P`L&g;}By8gMO?=BLSq){+G`wTkY8yt4vCfbu5T zyO1Us$YVt-85kJufqVpNTX8V(Ffp+(fg0BTz%nQ~2h`67H6cNLiegZI12m$Q#Rw{7 z!Sy+lUr`MxS1^Iwwzv2|t?Sex$XG=xXdxOqM5Gwv2C!>DZn(vjn356?k+T716i|NP zV=Q_EnnMLy3M=zLY!C)J0F)I=7+|9(j9}+#GT!2YFD**~t*60i6*%OI>=_vtz+==! zpcuv46bD-bn#wI<$YNZ;R08fmmoQ|pEMO`DHxWSo29M=wvO(%t9*8%J!J{nTeotO% zatYWgx41xg6Jj^mN+h?z!=h*w0|SE-C=fvY1C7{&MKq0zKza5SQ&H+IcBl^_7V<-R zkjk^DxCj(Ow*+CL@O%RjTnT zm4J1B^$;B+Jy1^%+<^smTEU%BaF_KKdv0cNNoigxqz}pi<>@8o7o~#7B5%QkK-Pkn z4BQfjse*N$i}k?k_=-Ri`?sVpWnnHV0`(DYv6WO7Wagz8fhtSzuqLQ|Q&Cc0lvn^6 z&Yle_1=vB=Pi9VPkt&GCoS9bw=>u1RG76{>jH?m+Q`Edp int: + pos = m.end() + marker = m.group(0) + mlen = len(marker) + _end_re = UNDERLINED_END_RE[marker] + m1 = _end_re.search(state.src, pos) + if not m1: + state.append_token({'type': 'text', 'raw': marker}) + return pos + end_pos = m1.end() + text = state.src[pos:end_pos-mlen] + prec_pos = self.precedence_scan(m, state, end_pos) + if prec_pos: + return prec_pos + new_state = state.copy() + new_state.src = text + new_state.in_underlined = True + state.append_token({ + 'type': 'underlined', + 'children': self.render(new_state), + }) + return end_pos + +def render_underlined_mu(self, token, state) -> str: + return '`_' + self.render_children(token, state) + '`_' + +def render_underlined_html(self, token, state) -> str: + return '' + self.render_children(token, state) + '' + +# === M I C R O N R E N D E R E R F O R M I S T U N E === +# from https://github.com/randogoth/md2mu + +class MicronRenderer(MarkdownRenderer): + """A renderer to format Micron text.""" + NAME = 'micron' + + def __call__(self, tokens, state: BlockState): + out = self.render_tokens(tokens, state) + # special handle for line breaks + out += '\n\n'.join(self.render_referrences(state)) + '\n' + return strip_end(out) + + def render_children(self, token, state: BlockState): + children = token['children'] + return self.render_tokens(children, state) + + def text(self, token: Dict[str, Any], state: BlockState) -> str: + return token['raw'] + + def emphasis(self, token: Dict[str, Any], state: BlockState) -> str: + return '`*' + self.render_children(token, state) + '`*' + + def strong(self, token: Dict[str, Any], state: BlockState) -> str: + return '`!' + self.render_children(token, state) + '`!' + + def link(self, token: Dict[str, Any], state: BlockState) -> str: + label = token.get('label') + text = self.render_children(token, state) + out = '`[' + text + '`' + if label: + return out + '`[' + label + '`' + attrs = token['attrs'] + url = attrs['url'] + if text == url: + return '`[' + text + '`' + elif 'mailto:' + text == url: + return '`[' + text + '`' + out += url + return out + ']' + + def image(self, token: Dict[str, Any], state: BlockState) -> str: + return self.link(token, state) + + def codespan(self, token: Dict[str, Any], state: BlockState) -> str: + return '`=' + token['raw'] + '`=' + + def linebreak(self, token: Dict[str, Any], state: BlockState) -> str: + return ' \n' + + def softbreak(self, token: Dict[str, Any], state: BlockState) -> str: + return '\n' + + def blank_line(self, token: Dict[str, Any], state: BlockState) -> str: + return '' + + def inline_html(self, token: Dict[str, Any], state: BlockState) -> str: + return '' + + def paragraph(self, token: Dict[str, Any], state: BlockState) -> str: + text = self.render_children(token, state) + return text + '\n\n' + + def heading(self, token: Dict[str, Any], state: BlockState) -> str: + level = token['attrs']['level'] + if level > 3: + level = 3 + marker = '>' * level + text = self.render_children(token, state) + return marker + ' ' + text + '\n\n' + def thematic_break(self, token: Dict[str, Any], state: BlockState) -> str: + return '-\n\n' + + def block_text(self, token: Dict[str, Any], state: BlockState) -> str: + return self.render_children(token, state) + '\n' + + def block_code(self, token: Dict[str, Any], state: BlockState) -> str: + code = token['raw'] + if code and code[-1] != '\n': + code += '\n' + marker = '`=' + return marker + '\n' + code + marker + '\n\n' + + def block_quote(self, token: Dict[str, Any], state: BlockState) -> str: + text = indent(self.render_children(token, state), '>>>>') + return text + '\n\n' + + def block_html(self, token: Dict[str, Any], state: BlockState) -> str: + return '' + + def block_error(self, token: Dict[str, Any], state: BlockState) -> str: + return '' + + def list(self, token: Dict[str, Any], state: BlockState) -> str: + return render_list(self, token, state) + +# === M A R K D O W N T O M I C R O N R E A D E R === + +class MarkdownToMicronReader(MarkdownReader): + enabled = True + file_extensions = ['md', 'markdown', 'mkd', 'mdown'] + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + + def _parse_metadata(self, meta): + """Return the dict containing document metadata""" + output = {} + for name, value in meta.items(): + name = name.lower() + if not DUPLICATES_DEFINITIONS_ALLOWED.get(name, True): + output[name] = self.process_metadata(name, value[0]) + elif len(value) > 1: + output[name] = self.process_metadata(name, value) + else: + output[name] = self.process_metadata(name, value[0]) + return output + + def read(self, source_path): + """Parse content and metadata of markdown files""" + + with pelican_open(source_path) as text: + lines = text.split('\n') + + meta = {} + key = None + if lines and BEGIN_RE.match(lines[0]): + lines.pop(0) + while lines: + line = lines.pop(0) + m1 = META_RE.match(line) + if line.strip() == '' or END_RE.match(line): + break # blank line or end of YAML header - done + if m1: + key = m1.group('key').lower().strip() + value = m1.group('value').strip() + try: + meta[key].append(value) + except KeyError: + meta[key] = [value] + else: + m2 = META_MORE_RE.match(line) + if m2 and key: + # Add another line to existing key + meta[key].append(m2.group('value').strip()) + else: + lines.insert(0, line) + break # no meta data - done + + metadata = self._parse_metadata(meta) + content = '\n'.join(lines) + + m2μr = MicronRenderer() + m2μ = Markdown(renderer=m2μr) + m2μ.inline.register('underlined', UNDERLINED, parse_underlined, before='emphasis') + m2μ.renderer.register('underlined', render_underlined_mu) + content = m2μ(content) + print(content) + return content, metadata + +# === M I C R O N W R I T E R === + +class MicronWriter(Writer): + + def __init__(self, output_path, settings): + super().__init__(output_path, settings) + self.output_path = settings.get('MICRON_PATH', 'micron/') + + def write_file(self, name, template, context, relative_urls=False, + paginated=None, template_name=None, override_output=False, + url=None, **kwargs): + template = template.environment.get_template( template.name.replace('.html', '.mu')) + name = name.replace('.html', '.mu') + if name is False or \ + name == "" or \ + not is_selected_for_writing(self.settings, + os.path.join(self.output_path, name)): + return + elif not name: + # other stuff, just return for now + return + + def _write_file(template, localcontext, output_path, name, override): + """Render the template write the file.""" + # set localsiteurl for context so that Contents can adjust links + if localcontext['localsiteurl']: + context['localsiteurl'] = localcontext['localsiteurl'] + output = template.render(localcontext) + path = sanitised_join(output_path, name) + + try: + os.makedirs(os.path.dirname(path)) + except Exception: + pass + + with self._open_w(path, 'utf-8', override=override) as f: + f.write(output) + + # Send a signal to say we're writing a file with some specific + # local context. + signals.content_written.send(path, context=localcontext) + + def _get_localcontext(context, name, kwargs, relative_urls): + localcontext = context.copy() + localcontext['localsiteurl'] = localcontext.get( + 'localsiteurl', None) + if relative_urls: + relative_url = path_to_url(get_relative_path(name)) + localcontext['SITEURL'] = relative_url + localcontext['localsiteurl'] = relative_url + localcontext['output_file'] = name + localcontext.update(kwargs) + return localcontext + + if paginated is None: + paginated = {key: val for key, val in kwargs.items() + if key in {'articles', 'dates'}} + + # pagination + if paginated and template_name in self.settings['PAGINATED_TEMPLATES']: + # pagination needed + per_page = self.settings['PAGINATED_TEMPLATES'][template_name] \ + or self.settings['DEFAULT_PAGINATION'] + + # init paginators + paginators = {key: Paginator(name, url, val, self.settings, + per_page) + for key, val in paginated.items()} + + # generated pages, and write + for page_num in range(list(paginators.values())[0].num_pages): + paginated_kwargs = kwargs.copy() + for key in paginators.keys(): + paginator = paginators[key] + previous_page = paginator.page(page_num) \ + if page_num > 0 else None + page = paginator.page(page_num + 1) + next_page = paginator.page(page_num + 2) \ + if page_num + 1 < paginator.num_pages else None + paginated_kwargs.update( + {'%s_paginator' % key: paginator, + '%s_page' % key: page, + '%s_previous_page' % key: previous_page, + '%s_next_page' % key: next_page}) + + localcontext = _get_localcontext( + context, page.save_as, paginated_kwargs, relative_urls) + _write_file(template, localcontext, self.output_path, + page.save_as, override_output) + else: + # no pagination + localcontext = _get_localcontext( + context, name, kwargs, relative_urls) + _write_file(template, localcontext, self.output_path, name, + override_output) + +def add_reader(readers): + readers.reader_classes['md'] = MarkdownToMicronReader + +def add_writer(pelican_object): + return MicronWriter + +def register(): + signals.readers_init.connect(add_reader) + signals.get_writer.connect(add_writer) \ No newline at end of file diff --git a/theme/README.md b/theme/README.md new file mode 100644 index 0000000..e69de29 diff --git a/theme/templates/404.mu b/theme/templates/404.mu new file mode 100644 index 0000000..992cca3 --- /dev/null +++ b/theme/templates/404.mu @@ -0,0 +1 @@ +PAGE NOT FOUND \ No newline at end of file diff --git a/theme/templates/archives.mu b/theme/templates/archives.mu new file mode 100644 index 0000000..3749c11 --- /dev/null +++ b/theme/templates/archives.mu @@ -0,0 +1 @@ +{% extends "index.mu" %} \ No newline at end of file diff --git a/theme/templates/article.mu b/theme/templates/article.mu new file mode 100644 index 0000000..5d94f17 --- /dev/null +++ b/theme/templates/article.mu @@ -0,0 +1,17 @@ +{% extends "base.mu" %} +{% block content %} + +>{{ article.title }} + + {% import 'translations.mu' as translations with context %} + {{ translations.translations_for(article) }} +{{ article.locale_date }} +{% if article.authors %} + +by {% for author in article.authors %}{{ author }}{% endfor %} + +{% endif %} + +{{ article.content }} + +{% endblock %} diff --git a/theme/templates/author.mu b/theme/templates/author.mu new file mode 100644 index 0000000..9482e6f --- /dev/null +++ b/theme/templates/author.mu @@ -0,0 +1,6 @@ +{% extends "index.mu" %} +{% block content_title %} +>>Articles by {{ author }} + +{% endblock %} + diff --git a/theme/templates/authors.mu b/theme/templates/authors.mu new file mode 100644 index 0000000..714ce8c --- /dev/null +++ b/theme/templates/authors.mu @@ -0,0 +1,9 @@ +{% extends "base.mu" %} +{% block content %} +>Authors on {{ SITENAME }} + +{%- for author, articles in authors|sort %} ++ `[{{ author }}`/{{ author.url }}] ({{ articles|count }}) + +{% endfor %} +{% endblock %} diff --git a/theme/templates/base.mu b/theme/templates/base.mu new file mode 100644 index 0000000..40c3099 --- /dev/null +++ b/theme/templates/base.mu @@ -0,0 +1,26 @@ +`# lang: {{ DEFAULT_LANG }} +{% block head %} +>{% block title %}{{ SITENAME }}{% endblock title %} +{% endblock head %} + +{% for title, link in MENUITEMS %} +`[{{ title }}`{{ link }}] +{% endfor %} +{% if DISPLAY_PAGES_ON_MENU %} +{% for p in PAGES %} +`[{{ p.title }}`/{{ p.url }}] +{% endfor %} +{% else %} +{% if DISPLAY_CATEGORIES_ON_MENU %} +{% for cat, null in categories %} +`[{% if cat == category %}`_{% endif %}{{ cat }}{% if cat == category %}`_{% endif %}`/{{ cat.url }}] +{% endfor %} +{% endif %} +{% endif %} + +{% block content %} +{% endblock %} + +{% if DESCRIPTION %} +{{ DESCRIPTION }} +{% endif %} \ No newline at end of file diff --git a/theme/templates/categories.mu b/theme/templates/categories.mu new file mode 100644 index 0000000..3961fc6 --- /dev/null +++ b/theme/templates/categories.mu @@ -0,0 +1,6 @@ +{% extends "base.mu" %} +{% block content %} +{% for category, articles in categories %} ++ `[{{ category }}`/{{ category.url }}] +{% endfor %} +{% endblock %} diff --git a/theme/templates/category.mu b/theme/templates/category.mu new file mode 100644 index 0000000..01597cb --- /dev/null +++ b/theme/templates/category.mu @@ -0,0 +1,5 @@ +{% extends "index.mu" %} +{% block content_title %} +>>{{ category }} +{% endblock %} + diff --git a/theme/templates/index.mu b/theme/templates/index.mu new file mode 100644 index 0000000..5d0c140 --- /dev/null +++ b/theme/templates/index.mu @@ -0,0 +1,17 @@ +{% extends "base.mu" %} +{% block content %} +{% block content_title %} +{% endblock %} + +{% for article in articles %} + ++[{{ article.locale_date }}] +>>>>`[`!{{ article.title }}`!`/{{ article.url }}] +>>>>{{ article.summary }} + +- + +{% endfor %} + +{% include 'pagination.mu' %} +{% endblock content %} diff --git a/theme/templates/page.mu b/theme/templates/page.mu new file mode 100644 index 0000000..0e5010d --- /dev/null +++ b/theme/templates/page.mu @@ -0,0 +1,8 @@ +{% extends "base.mu" %} +{% block title %}{{ page.title }}{%endblock%} +{% block content %} +>{{ page.title }} +{% import 'translations.html' as translations with context %} +{{ translations.translations_for(page) }} +{{ page.content }} +{% endblock %} diff --git a/theme/templates/pagination.mu b/theme/templates/pagination.mu new file mode 100644 index 0000000..976e703 --- /dev/null +++ b/theme/templates/pagination.mu @@ -0,0 +1,5 @@ +{% if DEFAULT_PAGINATION %} +- +{% if articles_page.has_previous() %}`[<<`/{{ articles_previous_page.url }}] {% endif %}Page {{ articles_page.number }} / {{ articles_paginator.num_pages }}{% if articles_page.has_next() %} `[>>`/{{ articles_next_page.url }}]{% endif %} + +{% endif %} diff --git a/theme/templates/period_archives.mu b/theme/templates/period_archives.mu new file mode 100644 index 0000000..3a15b28 --- /dev/null +++ b/theme/templates/period_archives.mu @@ -0,0 +1,10 @@ +{% extends "base.mu" %} +{% block content %} +>Archives for {{ period | reverse | join(' ') }} + +{% for article in dates %} ++[{{ article.locale_date }}] +>>>>`[`!{{ article.title }}`!`/{{ article.url }}] +>>>>{{ article.summary }} +{% endfor %} +{% endblock %} diff --git a/theme/templates/tag.mu b/theme/templates/tag.mu new file mode 100644 index 0000000..e69de29 diff --git a/theme/templates/tags.mu b/theme/templates/tags.mu new file mode 100644 index 0000000..4f8240f --- /dev/null +++ b/theme/templates/tags.mu @@ -0,0 +1,6 @@ +{% extends "base.mu" %} +{% block content %} +{% for tag, articles in tags %} ++ `[{{ tag }}`/{{ tag.url }}] +{% endfor %} +{% endblock %} diff --git a/theme/templates/translations.mu b/theme/templates/translations.mu new file mode 100644 index 0000000..e4a6eb6 --- /dev/null +++ b/theme/templates/translations.mu @@ -0,0 +1,8 @@ +{% macro translations_for(article) %} +{% if article.translations %} +{% for translation in article.translations %} +`[{{ translation.lang }}`/{{ translation.url }}] +{% endfor %} +{% endif %} +{% endmacro %} +