index.html
config.json
data.json
gen/
folder
Website root folder with HTML files, styles.css
CSS style file and assets/
folder. /gen/index.html
is the entry point to this website, also called dex.
backup
folder
Contains backup of data.json
. This backup is updated when data.json
is updated using files from the to_add/
folder.
to_add
folder
Files in this folder are added to dex. Add PDF, text, document, presentation and JSON files here then run
python run.py
When run once, text from files in this folder are added to dummy.json
. Edit dummy.json
before committing to source data.json
. Run again
python run.py
Once data are added to dummy.json
, files in the to_add/
folder are moved to the to_add/clear
subfolder.
Running run.py
again adds data from dummy.json
to data.json
and deletes dummy.json
. Run the above line twice to directly add files in to_add/
folder to data.json
data.json
Contains the source code for each webpage. data.json stores a list of objects in JSON format. Each object contains a title string and a body list of strings.
data.json =
[{
'title': 'title string 1',
'body': [paragraph_str1, paragraph_str2]},
{'title': 'title string 2',
'body': [paragraph_str3, paragraph_str4]}
]
Each object in this list of object generates a webpage. 'title' is the title of the HTML page and name of the HTML file for that page, for hyperlinking. Lowercase 'title' string without space and special characters (not number) is used for HTML filename of that webpage. For example, hyperlinking page title string 1
uses href='titlestring1.html'
.
This file is edited in an editor like Visual Studio Code to display text in the dex. Paragraph strings are edited to determine content in the dex.
config.json
Stores configuration variables for the dex as a dictionary in JSON format. config.json has the following parameters:
{ 'dexname': 'Dexweb Docs',
'author': 'Noorul Ali',
'index_template': ''
'page_template': '',
'page_javascript': '',
'index_javascript': '',
'index_list_type_para': false,
'index_list_no_page_link_only': true
}
dexname
: String of dex name. Visible in title section of index page, footer of every page and as HTML title. Default value: 'sample dex'
author
: String of dex author. Default value: 'dexweb'
index_template
: String of HTML index page template. Generates HTML index page. Editable in config.json for custom features on index page. Add custom JavaScript in script tag to embed JavaScript in index page.
page_template
: String of HTML page template for all pages (except index). Generates HTML webpages using data from data.json. Editable in config.json for custom features on each page. Add custom JavaScript in script tag to embed JavaScript in every page.'
page_javascript
: Not currently used. Planned update used string here to embed custom JavaScript in every page (except index).
page_javascript
: Not currently used. Planned update used string here to embed custom JavaScript in index page.
index_list_type_para
: Boolean (true/false). Default value: false. If true, links on index page have descriptions attached. The first string in the body list of each webpage is attached as description to its link on the index page. If false, links on index page only use title of each webpage.
index_list_no_page_link_only
: Boolean (true/false). Default value: true. If true, pages with only 1 string in their body list only containing a hyperlink are directly hyperlinked on the link of that page in the index page. For example, this object in data.json
[{'title': 'Research Engine', body:['< a href='https://alinoorul.github.io/researchengine'>Research Engine< /a>']}]
If 'index_list_no_page_link_only' == true
, this object generates a hyperlink (Research Engine) in the index page to the webpage https://alinoorul.github.io/researchengine. It does not link to a webpage in the dex but the webpage given by the hyperlink.
If 'index_list_no_page_link_only' == false
, this object generates a hyperlink (Research Engine) in the index page to researchengine.html
webpage in the dex. It links to a webpage in the dex.