Skip to content

Commit

Permalink
doc: first commit of docs
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusbaxter committed Aug 20, 2012
1 parent 60a5b3e commit e5f9e87
Show file tree
Hide file tree
Showing 5 changed files with 496 additions and 0 deletions.
70 changes: 70 additions & 0 deletions doc/Makefile
@@ -0,0 +1,70 @@
ASCIIDOC=asciidoc
XSLTPROC=xsltproc
DBLATEX=dblatex

RM ?= rm -f
CP ?= cp
MV ?= mv
CAT ?= cat
GEN-DOCINFO=gen-docinfo.pl

ifndef PERL_PATH
PERL_PATH = /usr/bin/perl
endif

ASCIIDOC_EXTRA += -a docinfo

SPEC_TXT=mor1kx.txt
SPEC_HTML=$(patsubst %.txt,%.html,$(SPEC_TXT))
SPEC_XML=$(patsubst %.txt,%.xml,$(SPEC_TXT))
SPEC_PDF=$(patsubst %.txt,%.pdf,$(SPEC_TXT))

SPEC_DOCINFO=$(patsubst %.txt,%-docinfo.xml,$(SPEC_TXT))

ifneq ($(findstring $(MAKEFLAGS),s),s)
ifndef V
QUIET_ASCIIDOC = @echo ' ' ASCIIDOC $@;
QUIET_XSLTPROC = @echo ' ' XSLTPROC $@;
QUIET_DBLATEX = @echo ' ' DBLATEX $@;
QUIET_GEN-DOCINFO = @echo ' ' GEN-DOCINFO $@;
export V
endif
endif

all: html

html: $(SPEC_HTML)
pdf: $(SPEC_PDF)

$(SPEC_DOCINFO): $(SPEC_TXT) $(GEN-DOCINFO)
$(QUIET_GEN-DOCINFO)$(CAT) $< | \
$(PERL_PATH) -ne 'if (/__vstart__/../__vend__/) {print unless /__v(start|end)__/}' | \
$(PERL_PATH) $(GEN-DOCINFO) > $@

$(SPEC_XML): $(SPEC_TXT) $(SPEC_DOCINFO)
$(QUIET_ASCIIDOC)$(ASCIIDOC) $(ASCIIDOC_EXTRA) -b docbook $<

XSLT = docbook.xsl
XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css \
--stringparam section.autolabel 1 \
--stringparam section.label.includes.component.label 1

$(SPEC_HTML): $(SPEC_XML)
$(QUIET_XSLTPROC)$(RM) $@+ $@ && \
$(XSLTPROC) $(XSLTOPTS) -o $@+ $(XSLT) $< && \
$(MV) $@+ $@

DBLATEXOPTS = --param=doc.publisher.show=0

$(SPEC_PDF): $(SPEC_XML)
$(QUIET_DBLATEX)$(RM) $@+ $@ && \
$(DBLATEX) $(DBLATEXOPTS) -o $@+ \
-p /etc/asciidoc/dblatex/asciidoc-dblatex.xsl \
-s /etc/asciidoc/dblatex/asciidoc-dblatex.sty $< && \
$(MV) $@+ $@

clean:
$(RM) *.xml *.xml+ *.html *.html+
$(RM) openrisc1200_spec.pdf+ openrisc1200_spec.txt+

.PHONY: all clean html
296 changes: 296 additions & 0 deletions doc/docbook-xsl.css
@@ -0,0 +1,296 @@
/*
CSS stylesheet for XHTML produced by DocBook XSL stylesheets.
Tested with XSL stylesheets 1.61.2, 1.67.2
*/

span.strong {
font-weight: bold;
}

body blockquote {
margin-top: .75em;
line-height: 1.5;
margin-bottom: .75em;
}

html body {
margin: 1em 5% 1em 5%;
line-height: 1.2;
font-family: sans-serif;
}

body div {
margin: 0;
}

h1, h2, h3, h4, h5, h6,
div.toc p b,
div.list-of-figures p b,
div.list-of-tables p b,
div.abstract p.title
{
color: #527bbd;
font-family: tahoma, verdana, sans-serif;
}

div.toc p:first-child,
div.list-of-figures p:first-child,
div.list-of-tables p:first-child,
div.example p.title
{
margin-bottom: 0.2em;
}

body h1 {
margin: .0em 0 0 -4%;
line-height: 1.3;
border-bottom: 2px solid silver;
}

body h2 {
margin: 0.5em 0 0 -4%;
line-height: 1.3;
border-bottom: 2px solid silver;
}

body h3 {
margin: .8em 0 0 -3%;
line-height: 1.3;
}

body h4 {
margin: .8em 0 0 -3%;
line-height: 1.3;
}

body h5 {
margin: .8em 0 0 -2%;
line-height: 1.3;
}

body h6 {
margin: .8em 0 0 -1%;
line-height: 1.3;
}

body hr {
border: none; /* Broken on IE6 */
}
div.footnotes hr {
border: 1px solid silver;
}

div.navheader th, div.navheader td, div.navfooter td {
font-family: sans-serif;
font-size: 0.9em;
font-weight: bold;
color: #527bbd;
}
div.navheader img, div.navfooter img {
border-style: none;
}
div.navheader a, div.navfooter a {
font-weight: normal;
}
div.navfooter hr {
border: 1px solid silver;
}

body td {
line-height: 1.2
}

body th {
line-height: 1.2;
}

ol {
line-height: 1.2;
}

ul, body dir, body menu {
line-height: 1.2;
}

html {
margin: 0;
padding: 0;
}

body h1, body h2, body h3, body h4, body h5, body h6 {
margin-left: 0
}

body pre {
margin: 0.5em 10% 0.5em 1em;
line-height: 1.0;
color: navy;
}

tt.literal, code.literal {
color: navy;
font-family: sans-serif;
}

code.literal:before { content: "'"; }
code.literal:after { content: "'"; }

em {
font-style: italic;
color: #064;
}

div.literallayout p {
padding: 0em;
margin: 0em;
}

div.literallayout {
font-family: monospace;
margin: 0em;
color: navy;
border: 1px solid silver;
background: #f4f4f4;
padding: 0.5em;
}

.programlisting, .screen {
border: 1px solid silver;
background: #f4f4f4;
margin: 0.5em 10% 0.5em 0;
padding: 0.5em 1em;
}

div.sidebar {
background: #ffffee;
margin: 1.0em 10% 0.5em 0;
padding: 0.5em 1em;
border: 1px solid silver;
}
div.sidebar * { padding: 0; }
div.sidebar div { margin: 0; }
div.sidebar p.title {
font-family: sans-serif;
margin-top: 0.5em;
margin-bottom: 0.2em;
}

div.bibliomixed {
margin: 0.5em 5% 0.5em 1em;
}

div.glossary dt {
font-weight: bold;
}
div.glossary dd p {
margin-top: 0.2em;
}

dl {
margin: .8em 0;
line-height: 1.2;
}

dt {
margin-top: 0.5em;
}

dt span.term {
font-style: normal;
color: navy;
}

div.variablelist dd p {
margin-top: 0;
}

div.itemizedlist li, div.orderedlist li {
margin-left: -0.8em;
margin-top: 0.5em;
}

ul, ol {
list-style-position: outside;
}

div.sidebar ul, div.sidebar ol {
margin-left: 2.8em;
}

div.itemizedlist p.title,
div.orderedlist p.title,
div.variablelist p.title
{
margin-bottom: -0.8em;
}

div.revhistory table {
border-collapse: collapse;
border: none;
}
div.revhistory th {
border: none;
color: #527bbd;
font-family: tahoma, verdana, sans-serif;
}
div.revhistory td {
border: 1px solid silver;
}

/* Keep TOC and index lines close together. */
div.toc dl, div.toc dt,
div.list-of-figures dl, div.list-of-figures dt,
div.list-of-tables dl, div.list-of-tables dt,
div.indexdiv dl, div.indexdiv dt
{
line-height: normal;
margin-top: 0;
margin-bottom: 0;
}

/*
Table styling does not work because of overriding attributes in
generated HTML.
*/
div.table table,
div.informaltable table
{
margin-left: 0;
margin-right: 5%;
margin-bottom: 0.8em;
}
div.informaltable table
{
margin-top: 0.4em
}
div.table thead,
div.table tfoot,
div.table tbody,
div.informaltable thead,
div.informaltable tfoot,
div.informaltable tbody
{
/* No effect in IE6. */
border-top: 2px solid #527bbd;
border-bottom: 2px solid #527bbd;
}
div.table thead, div.table tfoot,
div.informaltable thead, div.informaltable tfoot
{
font-weight: bold;
}

div.mediaobject img {
border: 1px solid silver;
margin-bottom: 0.8em;
}
div.figure p.title,
div.table p.title
{
margin-top: 1em;
margin-bottom: 0.4em;
}

@media print {
div.navheader, div.navfooter { display: none; }
}
17 changes: 17 additions & 0 deletions doc/docbook.xsl
@@ -0,0 +1,17 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/>
<xsl:output method="html" encoding="UTF-8" indent="no" />
<xsl:param name="generate.toc">
appendix nop
article toc,title
book toc,title,figure,table,example,equation
part nop
preface nop
qandadiv nop
qandaset nop
reference toc,title
section nop
set toc
</xsl:param>
</xsl:stylesheet>

0 comments on commit e5f9e87

Please sign in to comment.