Like this similar question, but for textile, is it possible to instruct textile, that headers should be numbered?
So
h1. first section
h1. second section
h2. subsection
would be rendered like:
1. first section
2. second section
2.1. subsection
The easiest way is to use the <ol><li> tags, see below. Note there is a white space after the header tags .h1{space} that can't be seen in the example.
<ol>
.h1
<li>first section
.h1
<li>second section
<ol>
h2.
<li>subsection
Related
I'm using Pandoc 2.17 to produce a reveal.js presentation. I'd like to produce output like:
<section>
<h2> Slide title>
<ul>
<li> This appears initially</li>
<li class="fragment">And this appears later.
</li<>
</ul>
</section>
Without the fragment I can get that easily with
# Slide Title
- This appears initially.
- This appears later
I can use fenced divs
::: {.fragment}
- This appears later
:::
Which will introduce an extra div (and break my unordered list into two lists) and apply .fragment to the div.
I can also insert the li element manually.
It looks like if I use the commonmark_x input format rather than pandoc flavored markdown I can do something like
- This appears later. {.fragment}
But reading this github issue suggests there is some standard syntax for incremental slides:
pandoc now includes a uniform syntax for transitions, which gets output as \pause in beamer and using fragment divs in revealjs. Of course, you can also just use a in the markdown source, but this won't be portable if you decide to switch to beamer.
I can't find that syntax though.
I'd also like to learn if there's something like the commonmark attributes extension I can use in pandoc flavored markdown.
So, I have found the syntax for incremental slides:
## Slide Title
- This appears initially.
::: incremental
- And this appears later.
:::
That introduces a secont bulleted list (the first bullet and the second are in different <ul> elements) and introduces paragraph elements around the text of the second bullet.
It also introduces an extra div.
This block of AsciiDoc will create a title and current revision information:
Writing Documentation using AsciiDoc
====================================
v2.0, February 2003:
Rewritten for version 2 release.
The docinfo_generator will extract this information from a comment block in an AsciiDoc-formatted document, then embed it in the docinfo.xml file:
////
:revinfo:
v1.0.3, Joseph HERLANT, 2013-08-18:
It matched only the last group. Correcting this to get only the first of each groups
to avoid getting data in the content of the document if defined in the header
v1.0.2, Joseph HERLANT, 2013-07-05: Adding a verbose flag to show more informations while processing data.
v1.0.1, Laurent LICOUR, 2013-06-05:
Correcting documentation.
If attributes were absent, the document did not generate. This is corrected now.
////
While useful, the revision history won't be included in the asciidoc-generated HTML (it might be in the a2x-gerneated HTML, but I haven't tested this).
I would like to find a way to embed the entire revision history in a asciidoc-formatted document, then have it displayed (ideally) at the end of said document as a table.
Is this possible?
You can define the sections [header] and [footer] in asciidoc.conf or in a separate file an then insert it with -f command line switch. Those sections contains HTML code, insert the {attr-name} where you need to insert your information. For example
[header]
<html>
<head>
<title>{title}</title>
</head>
<body>
[footer]
</body>
</html>
set the document title in the header tag.
Actually I use those section as a HTML template, so all the HTML page is defined there, the AsciiDoc compiled code will be inserted between the two sections.
I looked through the Pandoc HTML template and I wasn't able to find an option to include a header to the reference section when using pandoc-citeproc. Currently the output looks like the following:
<div class="references">
<p>Some References</p>
</div>
How would it be possible to insert a <h3>Reference</h3> block directly above it? Neither the template nor the documentation mention a $reference$ variable. This is the relevant section of the HTML template:
$body$
$for(include-after)$
$include-after$
$endfor$
I would want to add something like this:
$body$
<h3>References</h3>
$references$
$for(include-after)$
$include-after$
$endfor$
As it says here, the way to do this is to end your document with a level-1 header with the name of the references section. If you use --number-sections and don't want the references section numbered, you can include {.unnumbered} or just {-} after the title.
I am editing catalog/product/list.phtml.
I am definitely in the right file/theme etc since adding a <h1 Some Content /h1> at the top of the page will produce Some Content on the correct part of the page inside the dotted red line of the template path hints.
Any changes made further down the file however, where not showing up.
On closer inspection I found that my list.phtml contained an <ol> tag where as the information on the front end was contained within a <ul> tag.
I have no idea where magento is pulling this data from? Any ideas?
Say my some.rst file looks like this:
============
My Title
============
1. Section
================
2. Section
=================
After compiling, in the resulting some.html there will be a table of contents in the side bar that appears as:
My Title
Section
Section
Is there a simple way to remove 'My Title' from the table of contents in some.html?
I was able to solve this by using the .. raw:: html method as described above, with a slight tweak (that avoided breaking the auto-generated TOC). as described earlier, if your file only contains .. raw:: html headings, it will break the Sphinx auto-generated TOC. however, if you use .. raw:: html and add --------------------- below it, it won't show on the left-hand nav, and won't break the TOC.
e.g.
so i finally accidentally figured out how to get headings to not be displayed in the left-hand TOC. if your file only contains .. raw:: html h2 headings, it will break the sphinx auto-generated TOC (as mentioned in the stackoverflow article). however, if you use .. raw:: html and --------------------- below it, it won't show on the left-hand nav, and won't break the TOC :star2:
e.g.
.. raw:: html
<h2>What Can I Do With KSQL?</h2>
---------------------
The easy way is to use an object type that's ignored by the TOC directive:
.. rubric:: My Title
This creates text that looks somewhat like a heading, but is excluded from the TOC. You can update your CSS file with whatever style you want for the .rubric class, even mimicking h1 style if you like.
See "Non-TOC headings within a Restructuredtext page" for how to define rubric styled classes.
If you are trying to remove it from all of your documents, try customizing the default template. Otherwise you will need to modify the HTML builder by creating a subclass.
Very late to this party, I know. I just had this issue, needed to mimic h2 and was not able to edit the style sheet.
My solution ended up being adding raw html in the some.rst:
:raw-html:`<h1>My Title</h1>`
1. Section
================
2. Section
=================
You can make your own h3 tag.
For your header you use:
|start-h3| My title |end-h3|
Later at the end of the file you write:
.. |start-h3| raw:: html
<h3>
.. |end-h3| raw:: html
</h3>
It seems you are talking about a local TOC (a "on this page" TOC). Unfortunately, Sphinx always prints a document title as first item (<li>). Actual local TOC (section titles) are all nested <ul> inside the first document title <li>. (Yes, it is annoying.)
You have two options:
If current Sphinx theme has local TOC, you have to tweak produced HTML markup. For example, by hiding document title using CSS. Copy-pasting from https://techwriter.documatt.com/2021/sphinx-localtoc-remove-document-title.html:
.localtoc > ul {
margin: 0;
}
.localtoc > ul > li {
list-style-type: none;
}
.localtoc > ul > li > a {
display: none;
}
.localtoc > ul > li > ul {
// any additional styles to local toc <ul>
}
Alternative might be to manually print local TOC, e.g. at the beginning of a document with the contents:: directive and its :local: option. Example taken from https://restructuredtext.documatt.com/element/contents.html#no-current-document-title:
#################################
Contents without a document title
#################################
Testing ``contents::`` directive with ``:local:`` flag.
.. contents::
:local:
**********
Section L2
**********
Section L3
==========