From 22369f2f5dbedfabcd7abcbe86fe15a66131755b Mon Sep 17 00:00:00 2001 From: Michael Kapelko Date: Wed, 22 May 2019 14:31:38 +0300 Subject: [PATCH] Add pskov --- .gitignore | 3 + pskov/en/education.01.why.html | 208 + pskov/en/education.02.deps.html | 165 + pskov/en/education.03.site.html | 312 ++ pskov/en/education.04.lang.html | 251 ++ pskov/en/education.html | 141 + pskov/en/index.html | 96 + pskov/en/item.template | 93 + pskov/en/pskov-201905.html | 1 + pskov/index.html | 409 +- pskov/pskov-201905.html | 6758 +++++++++++++++++++++++++++++++ 11 files changed, 8029 insertions(+), 408 deletions(-) create mode 100644 pskov/en/education.01.why.html create mode 100644 pskov/en/education.02.deps.html create mode 100644 pskov/en/education.03.site.html create mode 100644 pskov/en/education.04.lang.html create mode 100644 pskov/en/education.html create mode 100644 pskov/en/index.html create mode 100644 pskov/en/item.template create mode 120000 pskov/en/pskov-201905.html create mode 100644 pskov/pskov-201905.html diff --git a/.gitignore b/.gitignore index 8b2bc87..2750770 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ *.pyc pelican/output/ + +# Ignore VIM temporary files. +*.swp diff --git a/pskov/en/education.01.why.html b/pskov/en/education.01.why.html new file mode 100644 index 0000000..b1af94b --- /dev/null +++ b/pskov/en/education.01.why.html @@ -0,0 +1,208 @@ + + + + + + + PSKOV - Opensource Game Studio static site generator + + + + +

+Education: 01. Why +

+
+ + + + + + + + + + + + + + + +
< BackIndexNext >
Not availableEducation02. Dependencies
+

+

In this document we briefly explain why PSKOV was created.

+

Estimated completion time: 5 minutes.

+

Table of contents

+ +

+

01. Why

+

You might know there already exist quite a lot of static site generators, why create another one? Because they are not good enough for Opensource Game Studio needs.

+

Here's a list of features we don't need:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Unwelcome featureNote
1Learning anything beyond HTML, CSS, JavaScript, and MarkdownThese technologies are enough to deliver information to users
2Server sideNobody should be able to pull the plug on you except yourself
3InstallationWe had enough updates that were never requested
4Comprehensible source codeSingle file with just enough number of lines
+

+

02. Features

+

Consequently, here is a list of PSKOV features:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PSKOV featureNote
1Bare HTML, CSS, JavaScript, and MarkdownNo need for template language, web framework or anything else
2Client sidePSKOV is a client side JavaScript application, it runs solely on your device
3Optional installationPSKOV is available at http://opengamestudio.org/pskov. However, if you want to keep PSKOV locally, you can get PSKOV single HTML file here and open it locally
4Comprehensible source codePSKOV is a single HTML file with less than 10000 lines of code
5Decades long support (DLS)You can use PSKOV on both Windows 2000 and Windows 2030*
+

* Windows 2030 does not (yet) exist, we simply refer to the fact that PSKOV is designed to work for operating systems released in the range of years 2000-2030

+

+ + + + diff --git a/pskov/en/education.02.deps.html b/pskov/en/education.02.deps.html new file mode 100644 index 0000000..f456461 --- /dev/null +++ b/pskov/en/education.02.deps.html @@ -0,0 +1,165 @@ + + + + + + + PSKOV - Opensource Game Studio static site generator + + + + +

+Education: 02. Dependencies +

+
+ + + + + + + + + + + + + + + +
< BackIndexNext >
01. WhyEducation03. Site
+

+ + + + diff --git a/pskov/en/education.03.site.html b/pskov/en/education.03.site.html new file mode 100644 index 0000000..7f8da3a --- /dev/null +++ b/pskov/en/education.03.site.html @@ -0,0 +1,312 @@ + + + + + + + PSKOV - Opensource Game Studio static site generator + + + + +

+Education: 03. Site +

+
+ + + + + + + + + + + + + + + +
< BackIndexNext >
02. DependenciesEducation04. Language
+

+

In this document we create a simple static web site with two pages.

+

Estimated completion time: ? minutes.

+

Table of contents

+ +

+

01. Inspiration

+

Suppose you are a great Russian painter named Valentin Serov. Everytime anyone wants to know about you they refer to Wikipedia. You wake up earlier today with a distinct desire to have your very own personal web site.

+

You set on to create the following pages:

+
    +
  • About me
  • +
  • Curriculum vitae (CV)
  • +
+

Some time later you have the following files in your site directory:

+
    +
  • cfg
  • +
  • item.template
  • +
  • index.md
  • +
  • cv.md
  • +
+

Let's look at their contents closer.

+

+

02. Investigate cfg file

+

cfg file has the following contents:

+
input = .
+item = item.template
+
+

cfg is an INI file with the following keys specified:

+ + + + + + + + + + + + + + + + + +
KeyDescription
inputPoints to a directory where item's file is located
itemPoints to an HTML template file that will be used to generate HTML files out of Markdown ones
+

In our case, item.template file is located alongside cfg, so we use . to denote current directory.

+

+

03. Investigate item.template file

+

item.template file has the following contents:

+
<!DOCTYPE html>
+<html>
+    <meta charset="utf-8">
+    <head>
+        <style>
+            - - - - Style was collapsed for brevity - - - -
+        </style>
+        <title>Serov</title>
+    </head>
+    <body>
+        <div id="header">
+            <strong>Serov</strong>
+            <a href="index.html">About me</a>
+            <a href="cv.html">CV</a>
+        </div>
+        <center>
+            <h1>PSKOV_ITEM_TITLE</h1>
+            <div class="contents">
+PSKOV_ITEM_CONTENTS
+            </div>
+        </center>
+    </body>
+</html>
+
+

Note: style was collapsed for brevity.

+

As you can see, item.template is an average HTML file with two constants specified:

+ + + + + + + + + + + + + + + + + +
PSKOV constantDescription
PSKOV_ITEM_TITLEProvides title from Title: part of page's header section
PSKOV_ITEM_CONTENTSProvides HTML contents generated out of Markdown contents
+

Notes:

+
    +
  • other PSKOV constants are described later
  • +
  • page's header section is described below
  • +
+

+

04. Investigate index.md and cv.md files

+

index.md file has the following contents:

+
 Title: About me
+ Slug: index
+
+ Hi, my name is Valentin Serov. Here's my self-portrait:
+
+ ![Valentin Serov self-portrait][serov-portrait]
+
+ - - - - Contents were collapsed for brevity - - - -
+
+ Have a look at my [CV][cv] now.
+
+ [serov]: https://en.wikipedia.org/wiki/Valentin_Serov
+ [revolution]: https://en.wikipedia.org/wiki/Russian_Revolution
+ [serov-portrait]: myself.jpg
+ [serov-work]: mywork.jpg
+ [girl-with-peaches]: https://en.wikipedia.org/wiki/Girl_with_Peaches
+ [pskov]: http://opengamestudio.org/pskov
+ [cv]: cv.html
+
+

index.md starts with a so-called header section:

+ + + + + + + + + + + + + + + + + +
Header constantDescription
Title:Provides value for PSKOV_ITEM_TITLE constant when generating HTML out of Markdown
Slug:Tells PSKOV that this particular Markdown file should be saved under <slug>.html filename
+

The rest of index.md contents is what any Markdown file looks like.

+

Note: cv page is referenced as cv.html, not cv.md

+

cv.md file has the following contents:

+
 Title: Curriculum vitae
+ Slug: cv
+
+ Here's my CV in case my paintings still interest you. I took a bit of a modern IT approach to structure my CV as key-value pairs of a dictionary (map), enjoy!
+
+ | Key | Value |
+ |---|---|
+ | Name | Valentin Serov |
+ | Age | 46 |
+ | Marital status | Married |
+ | Country | Russian Empire |
+ | Alma mater | Imperial Academy of Arts |
+ | Education | * Member Academy of Arts (1898) <br> * Full Member Academy of Arts (1903) |
+
+

As you can see, there's nothing new in cv.md except for a Markdown table.

+

+

05. Launch LFSA

+

Launch LFSA so that it points to directory with the files we just observed:

+
$ /path/to/local-file-system-access.py /path/to/dir/01.TwoPages
+
+

You should see output similar to this:

+
DIR: '/Users/kornerr/p/site-pskov-sample/01.TwoPages'
+PORT: '8000'
+
+

+

06. Generate the site

+

Now it's finally time to generate your personal web site:

+
    +
  • Go to Tool page
  • +
  • Make sure
      +
    • Path: points to the same directory you specified before
    • +
    • Input directory: and Item template: have values from cfg
  • +
  • Press Generate button to generate HTML files right where Markdown ones reside
  • +
  • Open generated index.html from the site's directory
  • +
  • You should see your web site running locally
  • +
+

Take time to observe your new shiny personal web site consisting of two pages.

+

+ + + + + + + + + + + + + + + +
< BackIndexNext >
02. DependenciesEducation04. Language
+
+ + + + diff --git a/pskov/en/education.04.lang.html b/pskov/en/education.04.lang.html new file mode 100644 index 0000000..c36864d --- /dev/null +++ b/pskov/en/education.04.lang.html @@ -0,0 +1,251 @@ + + + + + + + PSKOV - Opensource Game Studio static site generator + + + + +

+Education: 04. Language +

+
+ + + + + + + + + + + + + + + +
< BackIndexNext >
03. SiteEducation05. Blog
+

+

In this document we add language selection.

+

Estimated completion time: ? minutes.

+

Table of contents

+ +

+

01. Localization

+

Now that you have your web site in English you start to wonder why there's no Russian version, you're Russian after all!

+

You set on to create the following directory structure:

+
    +
  • cfg
  • +
  • en/item.template
  • +
  • en/index.md
  • +
  • en/cv.md
  • +
  • ru/item.template
  • +
  • ru/index.md
  • +
  • ru/cv.md
  • +
+

Let's look at the contents of these files closer.

+

+

02. Investigate cfg file

+

cfg file has the following contents:

+
input = en;ru
+item = item.template
+
+

As you see, input can accept multiple directories separated by ; symbol: PSKOV will go over each directory specified and run as before.

+

In this case, both en/ and ru/ directories have their own item.template file.

+

+

03. Investigate template files

+
    +
  • en/item.template contents:

    +
    - - - - Collapsed for brevity - - - -
    +        <title>Serov</title>
    +    </head>
    +    <body>
    +        <div id="header">
    +            <strong>Serov</strong>
    +            <a href="index.html">About me</a>
    +            <a href="cv.html">CV</a>
    +            <div id="lang">
    +                <a href="../en/PSKOV_ITEM_URL">EN</a>
    +                <a href="../ru/PSKOV_ITEM_URL">RU</a>
    +            </div>
    +        </div>
    +        <center>
    +- - - - Collapsed for brevity - - - -
    +
  • +
  • ru/item.template contents:

    +
    - - - - Collapsed for brevity - - - -
    +        <title>Серов</title>
    +    </head>
    +    <body>
    +        <div id="header">
    +            <strong>Серов</strong>
    +            <a href="index.html">Обо мне</a>
    +            <a href="cv.html">Резюме</a>
    +            <div id="lang">
    +                <a href="../en/PSKOV_ITEM_URL">EN</a>
    +                <a href="../ru/PSKOV_ITEM_URL">RU</a>
    +            </div>
    +        </div>
    +        <center>
    +- - - - Collapsed for brevity - - - -
    +
  • +
+

Note: beginning and ending were collapsed for brevity.

+

As you can see, both en/item.template and ru/item.template look similar to item.template we saw before.

+

The changes include:

+
    +
  • use of <div id="lang">...</div> section to present language selection
  • +
  • localization of titles into English and Russian
  • +
+

Language selection uses new PSKOV constant:

+ + + + + + + + + + + + + +
PSKOV constantDescription
PSKOV_ITEM_URLProvides <slug>.html value for the page
+

As you see, PSKOV_ITEM_URL is all you need to have your page in as many languages as you please.

+

+

04. Investigate Markdown files

+

en/index.md and en/cv.md files look exactly as before. ru/index.md and ru/cv.md are simply Russian variants of the same pages.

+

For example, ru/cv.md has the following contents:

+
 Title: Резюме
+ Slug: cv
+
+ Здесь вы можете увидеть моё резюме в том случае, если мои произведения всё ещё вас интересуют. Я использовал современный подход ИТ для структурирования своего резюме в виде пар ключ-значение словаря (карты). Наслаждайтесь!
+
+ | Ключ | Значение |
+ |---|---|
+ | Имя | Валентин Серов |
+ | Возраст | 46 |
+ | Семейное положение | Женат |
+ | Страна | Российская Империя |
+ | Учёба | Императорская Академия художеств |
+ | Звания | * академик ИАХ (1898) <br> * действительный член ИАХ (1903) |
+
+

Note: Russian page has exactly the same Slug: value as English one.

+

+

05. Launch LFSA and generate the site

+

Launch LFSA so that it points to directory with the files we just observed:

+
$ /path/to/local-file-system-access.py /path/to/dir/02.Language
+
+

Generate the site:

+
    +
  • Go to Tool page
  • +
  • Press Generate button
  • +
  • Open generated en/index.html or ru/index.html from the site's directory locally
  • +
  • Switch language to verify language selection works fine
  • +
+

Take time to observe just how little effort you spent to have your web site localized.

+

+ + + + + + + + + + + + + + + +
< BackIndexNext >
03. SiteEducation05. Blog
+
+ + + + diff --git a/pskov/en/education.html b/pskov/en/education.html new file mode 100644 index 0000000..546b8f9 --- /dev/null +++ b/pskov/en/education.html @@ -0,0 +1,141 @@ + + + + + + + PSKOV - Opensource Game Studio static site generator + + + + +

+Education +

+
+

Here you can find a set of documents to make you proficient in generating static sites with PSKOV. You are encouraged to read the documents in order.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DocumentDetailsDemonstrationEstimated completion time
1WhyFind out why PSKOV was created-5 minutes
2DependenciesInstall dependencies to start using PSKOV-?? minutes
3SiteLearn how to create a simple static web site with two pagesTODO Link?? minutes
4Language?TODO Link?
5Blog?TODO Link?
+
+ + + + diff --git a/pskov/en/index.html b/pskov/en/index.html new file mode 100644 index 0000000..8acae97 --- /dev/null +++ b/pskov/en/index.html @@ -0,0 +1,96 @@ + + + + + + + PSKOV - Opensource Game Studio static site generator + + + + +

+Tool +

+
+

PSKOV is a static site generator that runs in your web browser. What you see now has also been generated with PSKOV. If you're new to PSKOV, visit education page.

+ +
+ + + + diff --git a/pskov/en/item.template b/pskov/en/item.template new file mode 100644 index 0000000..ae0f3c4 --- /dev/null +++ b/pskov/en/item.template @@ -0,0 +1,93 @@ + + + + + + + PSKOV - Opensource Game Studio static site generator + + + + +

+PSKOV_ITEM_TITLE +

+
+PSKOV_ITEM_CONTENTS +
+ + + + diff --git a/pskov/en/pskov-201905.html b/pskov/en/pskov-201905.html new file mode 120000 index 0000000..b6acadf --- /dev/null +++ b/pskov/en/pskov-201905.html @@ -0,0 +1 @@ +../pskov-201905.html \ No newline at end of file diff --git a/pskov/index.html b/pskov/index.html index d2b51b7..5c2e90b 100644 --- a/pskov/index.html +++ b/pskov/index.html @@ -1,411 +1,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Local file system access -
Path:Updating...
- Configuration - -
Input directory: -
News item template: -
News preview template: -
Index template: -
Output directory: -
Log
- - + diff --git a/pskov/pskov-201905.html b/pskov/pskov-201905.html new file mode 100644 index 0000000..997e3df --- /dev/null +++ b/pskov/pskov-201905.html @@ -0,0 +1,6758 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Local file system access +
Path:Updating...
+ Configuration + +
Input directory:
Item template:
Preview template:
Index template:
Pagination 'Previous' template:
Pagination 'Next' template:
Pagination 'Previous/Next' template:
Preview characters limit:
Preview ending string:
Previews per page:
Preview page base name:
+ News + +
Log
+ + +