mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Add tables of contents to the references and FAQ.
This commit is contained in:
parent
6629968351
commit
05f3e00b27
5 changed files with 43 additions and 2 deletions
|
@ -1,5 +1,8 @@
|
|||
# Frequently Asked Questions
|
||||
|
||||
* Table of contents
|
||||
{:toc}
|
||||
|
||||
## Haml
|
||||
|
||||
### How do I put a punctuation mark after an element, like "`I like <strong>cake</strong>!`"?
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Haml (XHTML Abstraction Markup Language)
|
||||
|
||||
* Table of contents
|
||||
{:toc}
|
||||
|
||||
Haml is a markup language
|
||||
that's used to cleanly and simply describe the XHTML of any web document,
|
||||
without the use of inline code.
|
||||
|
@ -117,7 +120,7 @@ is compiled to:
|
|||
Any string is a valid element name;
|
||||
Haml will automatically generate opening and closing tags for any element.
|
||||
|
||||
#### {}
|
||||
#### `{}`
|
||||
|
||||
Brackets represent a Ruby hash
|
||||
that is used for specifying the attributes of an element.
|
||||
|
@ -905,7 +908,7 @@ is compiled to:
|
|||
2?
|
||||
</p>
|
||||
|
||||
#### -#
|
||||
#### `-#`
|
||||
|
||||
The hyphen followed immediately by the pound sign
|
||||
signifies a silent comment.
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# Sass (Syntactically Awesome StyleSheets)
|
||||
|
||||
* Table of contents
|
||||
{:toc}
|
||||
|
||||
Sass is a meta-language on top of CSS
|
||||
that's used to describe the style of a document
|
||||
cleanly and structurally,
|
||||
|
|
17
yard/full_doc_mods.rb
Normal file
17
yard/full_doc_mods.rb
Normal file
|
@ -0,0 +1,17 @@
|
|||
class YARD::Generators::FullDocGenerator
|
||||
protected
|
||||
|
||||
def generate_assets_with_haml
|
||||
generate_assets_without_haml
|
||||
|
||||
if format == :html && serializer
|
||||
template_file = find_template template_path(css_file)
|
||||
serializer.serialize(css_file,
|
||||
File.read(template_file) + File.read(File.dirname(__FILE__) + "/haml-style.css"))
|
||||
end
|
||||
|
||||
true
|
||||
end
|
||||
alias_method :generate_assets_without_haml, :generate_assets
|
||||
alias_method :generate_assets, :generate_assets_with_haml
|
||||
end
|
15
yard/haml-style.css
Normal file
15
yard/haml-style.css
Normal file
|
@ -0,0 +1,15 @@
|
|||
.maruku_toc {
|
||||
background: #ddd;
|
||||
border: 1px solid #ccc;
|
||||
margin-right: 2em;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.maruku_toc ul {
|
||||
padding: 0 1em;
|
||||
}
|
||||
|
||||
#frequently_asked_questions + .maruku_toc {
|
||||
float: none;
|
||||
margin: 0 2em;
|
||||
}
|
Loading…
Add table
Reference in a new issue