book/text/text_editing/sections.glyph in glyph-0.3.0 vs book/text/text_editing/sections.glyph in glyph-0.4.0
- old
+ new
@@ -1,8 +1,5 @@
-section[
- @title[Sections and Headers]
- @id[sec_head]
p[Glyph documents are normally organized as a hierarchical tree of nested chapters, appendixes, sections, etc. To define a section, use the %>[section], like so:]
highlight[=html|
section[
@@ -13,11 +10,11 @@
This section is nested into the previous one.
] --[End of Section #2]
] --[End of Section #1]
=]
- txt[This example defines two nested sections. If the code[@title] attribute is specified like in this case, it will be converted to a proper HTML header and it will appear in the table of contents (see the %>[toc]).
+ txt[This example defines two nested sections. If the code[@title] attribute is specified like in this case, it will be converted to a proper HTML header and it will appear in the Table of Contents (see the %>[toc]).
Note an important difference from HTML: there is no need for an explicit level for the headers, as it will be determined at runtime when the document is compiled, based on how sections are nested. The previous code snippet (taken as it is), for example, will be transformed into the following HTML code:]
highlight[=html|
<div class="section">
@@ -30,34 +27,6 @@
</div>
=]
txt[
By default, in Glyph the first header level is _2_, so the two headers are rendered as @h2@ and @h3@, respectively (@--\[...\]@ macros are _comments_, therefore they are not included in the final output).
-
-There are _a lot_ of macros that can be used in the same way as @section@, one for each element commonly used in =>[http://en.wikipedia.org/wiki/Book_design|book design]. Each one of them is a simple wrapper for a @<div>@ tag with a @class@ attribute set to its name.
-
-The following table lists the identifiers of all section-like macros, divided according to the part of the book they should be placed in:
]
- table[
- tr[
- th[Frontmatter]
- td[txt[@imprint@ ^†^, @dedication@ ^†^, @inspiration@ ^†^, @foreword@ ^‡^, @introduction@ ^‡^, @acknowledgement@ ^‡^, @prologue@ ^‡^, @toc@ ^*^]]
- ]
- tr[
- th[Bodymatter]
- td[txt[@volume@, @book@, @part@, @chapter@]]
- ]
- tr[
- th[Backmatter]
- td[txt[@epilogue@ ^‡^, @afterword@ ^‡^, @postscript@ ^†^, @appendix@, @addendum@ ^‡^, @glossary@ ^**‡^, @colophon@ ^†^, @bibliography@ ^**‡^, @promotion@ ^†^, @references@ ^**‡^, @index@ ^**‡^, @lot@ ^**‡^, @lof@ ^**‡^]]
- ]
- ]
-
- p[strong[*]: The %>[toc] is used to generate the Table of Contents automatically, and it takes no parameters.]
- p[strong[**]: This macro is likely to be extended in future versions to generate/aggregate content automatically.]
- p[strong[†]: This section is not listed in the Table of Contents.]
- p[strong[‡]: Any subsection of this section is not listed in the Table of Contents.]
-
- note[
- code[frontmatter], code[bodymatter] and code[backmatter] are also macro identifiers, but they are exposed as attributes for the %>[book] and the %>[article], so if you're using either of these two macros as your root macro for your document, there's no need to use them explicitly.
- ]
-]