Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
add section text anchors for HTML output
Browse files Browse the repository at this point in the history
The HTML documentation now have section anchors in the form of:
  * original section title (including spaces):
    http://doc.bareos.org/master/html/bareos-manual-main-reference.html#Section Title
  * section title, capitalized, without spaces
    http://doc.bareos.org/master/html/bareos-manual-main-reference.html#SectionTitleWithoutSpaces
  * section numbers
    chapter:
    http://doc.bareos.org/master/html/bareos-manual-main-reference.html#section1
    section:
    http://doc.bareos.org/master/html/bareos-manual-main-reference.html#section1.2
    subsection:
    http://doc.bareos.org/master/html/bareos-manual-main-reference.html#section1.2.3

These anchors are defined for chapters, section and subsections.
  • Loading branch information
joergsteffens committed Mar 31, 2015
1 parent f4b0ccc commit d0e1b1c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
31 changes: 31 additions & 0 deletions manuals/en/main/bareos-manual-main-reference.htlatex.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,35 @@
\labelOrig{#1}
}

\renewcommand{\chaptermark}[1]{%
\HCode{<A NAME='section\arabic{chapter}'></a>}%
\HCode{<A NAME='}#1\HCode{'></A>}%
\capitalizewords[e]{#1}%
\noblanks[e]{\thestring}%
\HCode{<A NAME='}\thestring\HCode{'></A>}%
\marginpar{\href{\#\thestring}{\#}}%
%\href{\#\thestring}{\#}%
}

\renewcommand{\sectionmark}[1]{%
\HCode{<A NAME='section\arabic{chapter}.\arabic{section}'></a>}
\HCode{<A NAME='}#1\HCode{'></A>}%
\capitalizewords[e]{#1}%
\noblanks[e]{\thestring}%
\noblanks[e]{\thestring}%
\HCode{<A NAME='}\thestring\HCode{'></A>}%
\marginpar{\href{\#\thestring}{\#}}%
%\href{\#\thestring}{\#}%
}

\renewcommand{\subsectionmark}[1]{%
\HCode{<A NAME='section\arabic{chapter}.\arabic{section}.\arabic{subsection}'></a>}
\HCode{<A NAME='}#1\HCode{'></A>}%
\capitalizewords[e]{#1}%
\noblanks[e]{\thestring}%
\HCode{<A NAME='}\thestring\HCode{'></A>}%
\marginpar{\href{\#\thestring}{\#}}%
%\href{\#\thestring}{\#}%
}

\EndPreamble
4 changes: 4 additions & 0 deletions manuals/en/main/bareos-manual-main-reference.tex
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
% \ifcsdef: check if a label is defined
\usepackage{etoolbox}

% string manipulations
% \capitalizewords, \noblanks
\usepackage{stringstrings}

\usepackage{bareos}

\makeindex
Expand Down

0 comments on commit d0e1b1c

Please sign in to comment.