ADD TO DEX


Add files
View website
Add data manually
Edit data.json and dummy.json files

Add files

Add PDF, JSON, TXT, PPTX and DOCX files in to_add/ folder and run

python run.py

This generates editable dummy.json in root directory. Editable dummy.json is for hyperlinks and formatting. Run again to make dex in gen/ folder

python run.py

View website
Open gen/index.html in a browser

Add data manually

Manually edit data.json. Run to regenerate website with new data (no backup functionality)

python run.py

Edit data.json and dummy.json files

data.json contains the source code for each webpage. data.json stores a list of objects in JSON format. Each webpage object contains a title string and a body list of strings. For example,

data.json = 
[{
	'title': 'title string 1',
	'body': [paragraph_str1, < a href='titlestring2.html'>Title String 2< /a>]},

	{'title': 'title string 2',
	'body': [paragraph_str3, < a href='titlestring1.html'>Title String 1< /a>]}
]

Alphanumberic title for each page without spaces and in lowercase forms the title of the HTML file. Add links by adding the < a> tag in strings in the body object for each webpage object. See example of both pages linked to each other above.

Strings in body form paragraphs of the webpage. data.json and dummy.json are lists of JSON objects. Each object in the list represents a webpage. The title of each page is unique. In case the same title is detected for 2 objects inside the data.json file or between data.json and dummy.json files, the objects are combined into 1 webpage with the same title and body strings combined. This functionality can be used to edit dummy.json.

To add to an existing page in data.json, use the same title in dummy.json for the webpage object as existing webpage object in data.json. This adds data to a specific webpage instead of creating a new one.








BACK TO DEXWEB DOCS