How to generate website with menu from an ASCII-Doc file? - compilation

I installed AsciiDoctor to generate html5-Websites from my ASCII-Doc files.
So far I did not find an option that generates a file like the one on e.g. http://www.asciidocfx.com/ or http://asciidoctor.org/docs/user-manual/ (i.e. (1) no footer with the date, (2) a menu on the left side and (3) linked headings.)
(How) Do I have to use templates for that?

I am not sure what you mean by "I have installed AsciiDoctor" are you using the Ruby version, the JavaScript version or the JVM Version (Ruby + JRuby)? How are you using Asciidoctor, directly from the command line or integrated in an other build system?
(1) I think (I am not sure about this one) that the footer is created if you have set the parameter docinfo1 to true. See Footer docinfo files.
(2) The menu on the left is called TOC (table of content), you might need add the parameter toc with the value left.
(3) The link on the headers are created when the parameter sectanchors has the value true. See the Anchors section.

Related

How to correctly use Sphinx sidebar options "globaltoc.html" to generate a collapsible menu tree

I resorted to using option html_sidebars template globaltoc.html to get a multi-level menu tree something as this:
1. Execution
1.1. Activities
1.1.1. Report
1.1.2. Follow up
By creating source files (.rst), I am able to build up the above scenario. On clicking the parent node Execution, the sub-nodes below all expand simultaneously. Later I added two more files, designed to be added at the end of last node. So the new menu tree looks like this:
1. Execution
1.1. Activities
1.1.1. Report
1.1.2. Follow up
1.1.3. Escalation
1.1.4. Final Submission
Now something peculiar is happening. When the top node Execution is clicked all the sub-nodes, including the newly added ones (1.1.3 and 1.1.4), expand at the same time (as I think they should be doing). However, when one of the older nodes, say, 1.1.1. Report is clicked, the new nodes 1.1.3 and 1.1.4 collapse. And to open the the new pages, I have to click on the top node 1. Execution to make the newer nodes visible again (so that these may be clicked to navigate to the doc).
I have run make clean html but situation has remained to same.
My question is: Am I correct in using globaltoc.html to build a collapsible menu tree in the sidebar. And if yes, what should be done to get the behavior (collapse/expand) right.
See the -a sphinx-build option.
If given, always write all output files. The default is to only write output files for new and changed source files. (This may not apply to all builders.)
Alternatively make clean, then make html would have the same result.

Add a warning directive at the top of every page on a Sphinx RTD site

I'd like to add a simple warning directive at the top of every page on a Sphinx RTD site:
.. attention::
The next major release of this project will launch on X date.
In the meantime, we're looking for feedback.
If you'd like an early preview, please reach out at someemail#someaddress.com!
What's the simplest way to do this? I'm using the sphinx_rtd_theme.
I can see how to add a block using the extrabody block, but it appears outside the main content area and is positioned and styled totally independently.
Ideally, I'd want this block to show up at an attention directive just below the breadcrumbs on every page.
You could add this to the conf.py Sphinx configuration file:
rst_prolog = """.. attention::
The next major release is imminent.
"""
and it will be included at the beginning of every source file that is read ‒ see https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-rst_prolog.
F-string literals work too, so f'This is release #{release}' will substitute that variable value.

How to fold all the second level section in Sphinx?

I'm using the readthedocs theme for a personal sphinx documentation project. Everything works fine except the display of the left frame of the content list: It display all level of section headings, without showing any hierarchy. How to let it show levels as in most readthedocs documentation project?
After click the + sign, it looks right:
This is how I mark the section title:
Apache
======
How to restart
--------------
This sounds like this bug: Toc not expanding.
If not, please include your version of Sphinx, where you build the docs, and whether what you do to build the docs satisfies the conditions of that issue.
Otherwise, there is no configurable option to expand all options in the for the RTD Sphinx theme. See https://sphinx-rtd-theme.readthedocs.io/en/latest/configuring.html#toc-options You will have to write custom JavaScript to make it so, and include the static asset with the theme. That homework is left to the questioner or a gracious answerer.
You could also file a feature request at https://github.com/rtfd/sphinx_rtd_theme/issues/new
This is the default behavior of sphinx. The section that you select expands on the left side bar. Else, it remains collapsed. https://docs.readthedocs.io/en/latest/versions.html this link also shows similar kind of behavior. To make it collapsible on clicking, you will require to update the theme.

create dynamic template for joomla 1.5

there are tutorials on the web about gow to create index.html, css file and template.xml that contain placeholders. ok, i got it, it's simple. but i need a template that has some different views. for example:
-all pages have a topmenu, header, left sidebar, mainarea and a footer but:
-first page has no header .topmenu after which sidebar, mainarea and footer comes.
-second page has sidebar moved from left to right
-third page has four blocks (blocks for special offers) instead of mainarea.
as far as i can see, i need to create three standalone templates with unique set of placeholders for each template. because i can't see the way to change laarge mainarea placeholder with four placeholders for offers blocks on some pages. dynamically.
is there if-statements in joomla templates to simply determine a document id to view four placeholders instead of mainarea. or to not show header on the main page (f.e. doc. id="mainpage")
but i want it to be selectable like:
-this page has first case of that template (index_1.php)
-and that page has a second case of the same template (index_2.php)
like a selectbox.
is that possible?
I will make this an answer as opposed to a comment since I believe it will do what you are looking for.
Once your articles are setup and your links to them are established (the site has the info on it you're looking for), you can create the modules containing the data that you want shown from time to time.
Go to the module manager - on the right you should see 'module assignment' or something along the lines of 'display this module on the following pages'; you can then pick which pages you want the module to show on. You can specify all pages, none, specific pages, however you want.
This will enable you to show them only where needed however you like.
You can ALSO do this programatically inside the module (if you do custom HTML and use an extension like Sourcerer to add PHP to the module) with PHP should you want a little more flexibility, but just choosing the pages to show on should work for what you're doing.

Forced line break after option name

Default product options view place the option name on a line, forces a line break, and then displays options beneath.
Anyone know where/which changes need to be made to remove the line break so that the option choice displays next to the option name?
I'm using Magento 1.6.2 Community. Thanks!
You can achieve this with just css, just put a float left on the label and inputbox.
The easiest way to find out where a template file is located in magento is to turn on template path hints
See How do I turn on template path hints
Also you may want to use 'chrome inspect element' or 'firebug for firefox' to see if you can restyle it using css.

Resources