Table of Contents
So here it the state of things. The web is extremely looks and not efficient programming for webpages.
Web pages are very heavy in their content when they don't need to be.
Most web pages are designed to attract people to something that looks professional and pretty to draw in money when the services or products could be sub standard. The choice of whether to use a product or service has to be done through critical comparison, which most people don't do and I am guilty of that. We don't have time. Hence money not quality rules. WYSIWYG
I have been through many free software alternatives and rarely seen good integration of programming with WYSIWYG applications. I am able to use LibreOffice for WYSIWYG and programming. I like the Table of Contents in LibreOffice.
This is how I get some web pages made sometimes.
Even though I used LibreOffice, I have to make a table of contents, save the document. Open of the web editor to add scripts. Then save again. This is annoying.
I would like LibreOffice to br more integrated with the web like Confluence. I love the free service of Confluence but I had a heck of a time letting the public have read access --- thought its suppose to be easy. And multiple times my free account was terminated because I didn't’t log in in a while. I can’t have that.
BTW, this solution sucks. I will be looking for WYSIWYG solutions that are good for programming which is free and easy to use. Is been a while since I worked on webpages, so excuse my ignorance.
It is assumed you will be able to get these softwares installed. We will not be going into detail how to install them.
Install LibreOffice
https://www.libreoffice.org/get-help/install-howto/
Install Docker
https://docs.docker.com/engine/install/
If Windows, install cygwin
https://cygwin.com/install.html
OPTIONAL Install Kompozer
install Notepad++ and PSPad editor
http://www.pspad.com/en/download.htm
Edit the original web page in LibreOffice. DO NOT USE THE WEB EDITOR YET.
Make all your sections.
Add a table of contents.
Save as an HTML page.
Open up the HTML in LibreOffice again, and it should go to the web editor. Make sure you using the web editor.
Add table of contents.
Use the script option under “insert” to put in hidden commands. It should be able to embed commands from multiple languages,
OR edit with Kompozer or other test editor.
Insert hidden commands or modify for PHP or other language.
This is an example with server includes, but could be used with other languages. Just keeping it simple.
Assuming we have Linux.
Links
https://httpd.apache.org/docs/2.4/howto/ssi.html
Run ae2mod
Select includes module
Make it active
Edit Apache to use server side includes
You can do this by editing the Apache config files
OR by editing the Apache config files to allow .htaccess, which is easiest.
In Apache under the document directory
Options +Includes
You must include this to allow .htaccess files. It it suggested you limit this only to certain directories.
Example:
Options All AllowOverride all Require all granted
Make a .htaccess file in a directory which allows includes.
Contents should be
AddType text/html .shtml AddHandler server-parsed .shtml Options Indexes FollowSymLinks Includes
Make a sample web page with the include
<!--#echo var="DATE_LOCAL" >xsxsx>
View the web page. See if the date pops up.
To put commands in the header
View HTML source mode
Go to the <header> section
Add <script> My STUFF </script>
Make sure you put the content of body down one line because a little box for this script will appear.
You can edit this box. It may move to the top of the header section instead of leaving it where it is.
To update the table of contents, it will ruin the embedded scripts.
Open document in LibreOffice Writer and not the web editor.
You might have to open up Writer and copy and paste into it.
Update of table of contents.
Save.
Save it as html if you started as a text document in Writer.
Open in web editor.
Put back in the script commands.
Save.
Yes this is very annoying, but the table of contents is worse to make manually.
This is a BIG suggestion:
Put one line script commands in.
In should load a library and execute methods.
Or one line commands.
Why? In case you blow the scripts away, its easy to put back in,.
Document how and which commands or methods should be put into the documents. Make it simple.
Other suggestions
Space the body down one line. Then you can put commands in the header section.
Just before the first text, it will put a script in the body section of the webpage.
The last line will put a footer in the webpage.
DO NOT EDIT the scripts in HTML mode or it might get deleted.
I think if you edit in HTML mode and save an reopen then it
will not delete them.