Add some styling to doc, improve top menu

* doc/snippet-expansion.org:
* doc/snippet-organization.org: Fix typos.
* doc/stylesheets/manual.css: Add some simple styling.  Mainly, this
sets 'max-width' for the main text, and centers it.  Adjust the
background color.
* doc/nav-menu.html.inc: Adjust 'class' of top menu.
* doc/yas-doc-helper.el (yas--make-preamble): New function, used for
:html-preamble.  It sets the element for the current page in the top
menu as bolded text to aid navigation.
* doc/stylesheets/styles.css: Remove, it was unused since the old rst
manual was removed.
This commit is contained in:
Noam Postavsky 2018-02-17 19:55:36 -05:00
parent 0afc638e16
commit e261832b1a
6 changed files with 46 additions and 113 deletions

View File

@ -3,8 +3,8 @@
<li> <a href="index.html">Overview</a> <li> <a href="index.html">Overview</a>
<li> <a href="https://github.com/joaotavora/yasnippet/blob/master/README.mdown"> <li> <a href="https://github.com/joaotavora/yasnippet/blob/master/README.mdown">
Intro and Tutorial</a> Intro and Tutorial</a>
<li class="center">Snippet <li class="center border">Snippet
<ul> <ul class="nopad">
<li> <a href="snippet-organization.html">Organization</a> <li> <a href="snippet-organization.html">Organization</a>
<li> <a href="snippet-expansion.html">Expansion</a> <li> <a href="snippet-expansion.html">Expansion</a>
<li> <a href="snippet-development.html">Development</a> <li> <a href="snippet-development.html">Development</a>

View File

@ -21,7 +21,7 @@
- Using hippie-expand - Using hippie-expand
- Call [[sym:yas-insert-snippet][=yas-insert-snippet=]] (use =M-x yas-insert-snippet== or its - Call [[sym:yas-insert-snippet][=yas-insert-snippet=]] (use =M-x yas-insert-snippet= or its
keybinding =C-c & C-s=). keybinding =C-c & C-s=).
- Use m2m's excellent auto-complete - Use m2m's excellent auto-complete

View File

@ -4,8 +4,9 @@
* Basic structure * Basic structure
Snippet collections can be stored in plain text files. They are arranged by Snippet collections can be stored in plain text files. They are
sub-directories naming *snippet tables*. These mostly name Emacs major names. arranged by sub-directories naming *snippet tables*. These mostly
name Emacs major mode names.
#+begin_example #+begin_example
. .

View File

@ -1,5 +1,14 @@
nav > ul > li.center > ul { .center { margin-left: auto; margin-right: auto; text-align: center; }
padding: 0; .current {
font-weight: bold;
background-color: #E0E8F0;
}
body { background-color: #E4F0F4 }
div#content {
max-width: 20cm;
margin-left: auto;
margin-right: auto;
} }
nav li { nav li {
@ -9,20 +18,22 @@ nav li {
list-style-type: none; list-style-type: none;
padding: 0.5em; padding: 0.5em;
} }
nav > ul > li { nav > ul > li {
display: inline-block; display: inline-block;
} }
.nopad {
/* match org's css for <pre> */ padding: 0;
code { }
background-color: #F3F5F7; li.border {
font-family: courier, monospace; border: solid;
border-width: 1px;
} }
#content { pre, code{ background-color: #F3F5F7; }
margin-left: 5%; code {
margin-right: 10%; /* http://neugierig.org/software/chromium/notes/2009/09/monospace-fonts-workaround.html */
font-family: WorkAroundWebKitAndMozilla, monospace;
white-space: nowrap;
} }
/* Styles for htmlize.el fontification. */ /* Styles for htmlize.el fontification. */

View File

@ -1,93 +0,0 @@
@media all
{
body {
margin: 1em auto;
/*margin: 10px 18% 10px 18%;*/
font-family: Arial;
/*text-align: justify;*/
font-size: 14pt;
padding: 10px;
line-height: 1.2em;
max-width: 600pt;
}
div#table-of-contents {
position: fixed;
left: 0%;
right: 0%;
top: 0px;
z-index: 100;
background: black;
}
div#table-of-contents h2 {
display: none;
}
div#table-of-contents a {
text-decoration: none;
color: white;
}
div#table-of-contents a:visited {
color: white;
}
div#table-of-contents a:hover {
color: orange;
}
div.outline-2 h2{
padding-top: 50px;
}
div#text-table-of-contents {
text-color: white;
text-align: center;
margin-left: 30%;
margin-right: 30%;
}
div#text-table-of-contents ul {
height: 2em;
width: 500px;
list-style: none;
margin: auto;
}
div#text-table-of-contents ul li {
float: left;
margin-left:auto;
margin-right: auto;
padding-left: 10px;
}
div#postamble{
position: fixed;
width: 800px;
height: 250px;
left: 50%;
right: 50%;
margin:-75px 0 0 -400px;
bottom: -20px;
font-size: 10pt;
color: grey;
background: url('siscog-bottom-logo.png') no-repeat;
/* background-size: 100% 100%; */
}
div#postamble *{
display: none;
}
div#postamble p.date{
position: relative;
bottom: -200px;
text-align: center;
display: block;
}
}

View File

@ -118,6 +118,22 @@
;; This lets all the org files be exported to HTML with ;; This lets all the org files be exported to HTML with
;; `org-publish-current-project' (C-c C-e P). ;; `org-publish-current-project' (C-c C-e P).
(defun yas--make-preamble (props)
"Return contents of nav-menu-html.inc.
But replace link to \"current\" page with a span element."
(with-temp-buffer
(let ((dir (file-name-directory (plist-get props :input-file))))
(insert-file-contents (expand-file-name "nav-menu.html.inc" dir))
(goto-char (point-min))
(search-forward (concat "<a href=\""
(file-name-nondirectory
(plist-get props :output-file))
"\">"))
(replace-match "<span class='current'>")
(search-forward "</a>")
(replace-match "</span>")
(buffer-string))))
(let* ((dir (if load-file-name (file-name-directory load-file-name) (let* ((dir (if load-file-name (file-name-directory load-file-name)
default-directory)) default-directory))
(src-epoch (getenv "SOURCE_DATE_EPOCH")) (src-epoch (getenv "SOURCE_DATE_EPOCH"))
@ -138,10 +154,8 @@
`(,@(when (fboundp 'org-html-publish-to-html) `(,@(when (fboundp 'org-html-publish-to-html)
'(:publishing-function org-html-publish-to-html)) '(:publishing-function org-html-publish-to-html))
:base-directory ,dir :publishing-directory ,dir :base-directory ,dir :publishing-directory ,dir
:html-preamble :html-preamble yas--make-preamble
,(with-temp-buffer ;;:with-broken-links mark
(insert-file-contents (expand-file-name "nav-menu.html.inc" dir))
(buffer-string))
:html-postamble :html-postamble
,(concat "<hr><p class='creator'>Generated by %c from " ,(concat "<hr><p class='creator'>Generated by %c from "
(or rev yas--version) " " date "</p>\n" (or rev yas--version) " " date "</p>\n"