mint 0.7.4 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +23 -14
  3. data/LICENSE +22 -0
  4. data/README.md +82 -56
  5. data/bin/mint +47 -10
  6. data/bin/mint-epub +1 -4
  7. data/config/templates/base/style.css +187 -0
  8. data/config/templates/default/css/style.css +126 -79
  9. data/config/templates/default/layout.erb +10 -0
  10. data/config/templates/default/style.css +237 -0
  11. data/config/templates/garden/layout.erb +38 -0
  12. data/config/templates/garden/style.css +303 -0
  13. data/config/templates/newspaper/layout.erb +16 -0
  14. data/config/templates/nord/layout.erb +11 -0
  15. data/config/templates/nord/style.css +339 -0
  16. data/config/templates/nord-dark/layout.erb +11 -0
  17. data/config/templates/nord-dark/style.css +339 -0
  18. data/config/templates/protocol/layout.erb +9 -0
  19. data/config/templates/protocol/style.css +25 -0
  20. data/config/templates/zen/layout.erb +11 -0
  21. data/config/templates/zen/style.css +114 -0
  22. data/lib/mint/command_line.rb +253 -111
  23. data/lib/mint/css.rb +11 -4
  24. data/lib/mint/css_template.rb +37 -0
  25. data/lib/mint/document.rb +185 -43
  26. data/lib/mint/helpers.rb +50 -10
  27. data/lib/mint/layout.rb +2 -3
  28. data/lib/mint/markdown_template.rb +47 -0
  29. data/lib/mint/mint.rb +181 -114
  30. data/lib/mint/plugin.rb +3 -3
  31. data/lib/mint/plugins/epub.rb +1 -2
  32. data/lib/mint/resource.rb +19 -9
  33. data/lib/mint/style.rb +10 -14
  34. data/lib/mint/version.rb +1 -1
  35. data/lib/mint.rb +1 -0
  36. data/man/mint.1 +135 -0
  37. data/spec/cli/README.md +99 -0
  38. data/spec/cli/argument_parsing_spec.rb +207 -0
  39. data/spec/cli/bin_integration_spec.rb +348 -0
  40. data/spec/cli/configuration_management_spec.rb +363 -0
  41. data/spec/cli/full_workflow_integration_spec.rb +527 -0
  42. data/spec/cli/publish_workflow_spec.rb +368 -0
  43. data/spec/cli/template_management_spec.rb +300 -0
  44. data/spec/css_spec.rb +1 -1
  45. data/spec/document_spec.rb +102 -69
  46. data/spec/helpers_spec.rb +42 -42
  47. data/spec/mint_spec.rb +104 -80
  48. data/spec/plugin_spec.rb +86 -88
  49. data/spec/run_cli_tests.rb +95 -0
  50. data/spec/spec_helper.rb +8 -1
  51. data/spec/style_spec.rb +18 -16
  52. data/spec/support/cli_helpers.rb +169 -0
  53. data/spec/support/fixtures/content-2.md +16 -0
  54. data/spec/support/matchers.rb +1 -1
  55. metadata +116 -223
  56. data/config/syntax.yaml +0 -71
  57. data/config/templates/base/style.sass +0 -144
  58. data/config/templates/default/layout.haml +0 -8
  59. data/config/templates/default/style.sass +0 -36
  60. data/config/templates/protocol/layout.haml +0 -7
  61. data/config/templates/protocol/style.sass +0 -20
  62. data/config/templates/zen/css/style.css +0 -145
  63. data/config/templates/zen/layout.haml +0 -7
  64. data/config/templates/zen/style.sass +0 -24
  65. data/features/config.feature +0 -21
  66. data/features/plugins/epub.feature +0 -23
  67. data/features/publish.feature +0 -73
  68. data/features/support/env.rb +0 -15
  69. data/features/templates.feature +0 -79
  70. data/spec/command_line_spec.rb +0 -87
  71. data/spec/plugins/epub_spec.rb +0 -242
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 70a879d8b2c0b7150b6535b2c2c00c366d3e8484c499c7c0065e76bd5454b768
4
+ data.tar.gz: a2595df94714597a9937a232115b963c096b6b71acbe373878a700181653adb4
5
+ SHA512:
6
+ metadata.gz: 1ca15ee5ad05556ca6d7aef47d2f74f048a2f2cd7c11fc78931ffd6af7a36417dc65c04dae0661b53a71c9515dcdef09557d7538e0607da161a424061e3049f6
7
+ data.tar.gz: 4d2b342e58022fde932ad266825bfed9d2b08ba029c0b0469868560a7d87e69383d8c0eab5fa3b28e63630283a33e808cb6319fd4ae9f0bc9734ca93dbea2598
data/Gemfile CHANGED
@@ -1,18 +1,27 @@
1
- source :rubygems
1
+ source "https://rubygems.org"
2
2
 
3
- gem "tilt"
4
- gem "rdiscount"
5
- gem "haml"
6
- gem "sass"
7
- gem "less"
8
- gem "activesupport"
3
+ # General
4
+ gem "rubyzip", "~> 3.0", ">= 3.0.1"
5
+ gem "hashie", "~> 5.0"
6
+ gem "nokogiri", "1.15.5"
9
7
 
10
- gem "rubyzip"
11
- gem "hashie"
12
- gem "nokogiri"
8
+ # Templates
9
+ gem "tilt", "~> 2.6", ">= 2.6.1"
10
+ gem "redcarpet", "~> 3.6", ">= 3.6.1"
11
+ gem "erubis", "~> 2.7"
12
+ gem "haml", "~> 6.3"
13
+ gem "sass-embedded", '~> 1.90'
13
14
 
14
- gem "rspec"
15
- gem "cucumber"
16
- gem "aruba"
15
+ # Helpers
16
+ gem "activesupport", "~> 8.0", ">= 8.0.2.1"
17
17
 
18
- gem "debugger"
18
+ group :development do
19
+ gem "pry"
20
+ end
21
+
22
+ # Testing dependencies
23
+ group :test do
24
+ gem "rspec", "~> 3.13", ">= 3.13.1"
25
+ gem "rspec-its", "~> 1.3"
26
+ gem "colorize", "~> 1.1"
27
+ end
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 David Jacobs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included
14
+ in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
+ DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,111 +1,137 @@
1
- What is Mint?
2
- -------------
1
+ # What is Mint?
3
2
 
4
- Mint transforms your plain text documents into beautiful documents. It makes that process as simple (but customizable) as possible.
3
+ Mint transforms your plain text documents into beautiful documents. It makes the process simple but customizable.
5
4
 
6
5
  Why would you want to keep all of your documents as plain text?
7
6
 
8
7
  - To focus on words and structure when you write
9
- - To be able to apply one style to an entire set of documents with one command
10
- - To keep your documents under version control
11
- - To make your documents available for scripting--for example, text analysis
8
+ - To control style with a single command, independently of document structure
9
+ - To keep your text and formatting under version control
10
+ - To make your text amenable to scripting--for example, text analysis
12
11
 
13
- What does Mint create from these source files? Beautiful, styled HTML ready to print, e-mail, and present.
12
+ What does Mint create from these source files? Beautiful, styled HTML ready to print, e-mail, export, and present.
14
13
 
15
14
  In a few words: *Mint processes words so you don't have to.*
16
15
 
17
- The mint command
18
- ----------------
16
+ ## The mint command
19
17
 
20
- If you have a plain text document formatted in Markdown or Textile or almost any other templating language, you're ready to go.
18
+ If you have a plain text document formatted in Markdown or Textile or almost any other templating
19
+ language, you're ready to go.
21
20
 
22
- The easiest Mint command doesn't require configuration. It transforms a document into HTML and links it to the default stylesheet, which I've designed for you.
21
+ The easiest Mint command doesn't require configuration. It transforms a document into HTML and links
22
+ it to the default stylesheet, which I've designed for you.
23
23
 
24
24
  Simply type:
25
25
 
26
- mint publish Minimalism.md
26
+ mint publish Document.md
27
27
 
28
- And voilà, Minimalism.html will show up next to Minimalism.md.
28
+ And voilà, Minimalism.html will show up next to Document.md.
29
29
 
30
- Opening Minimalism.html with your favorite web browser--[Firefox is best for typography][Firefox typography], but Webkit-based browsers (Chrome, Safari) work, too--will show what looks like a word-processed document, complete with big bold headers, italic emphasis, automatically indented and numbered lists, and bullets. If you're in a modern browser, you'll even see ligatures and proper kerning. The page will be on a white canvas that looks like a page, even though you are in a browser.
30
+ Opening Minimalism.html with your favorite web browser--[Firefox is best for typography][Firefox
31
+ typography], but Webkit-based browsers (Chrome, Safari) work, too--will show what looks like a
32
+ word-processed document, complete with big bold headers, italic emphasis, automatically indented
33
+ and numbered lists, and bullets. If you're in a modern browser, you'll even see ligatures and
34
+ proper kerning. The page will be on a white canvas that looks like a page, even though you are in a
35
+ browser.
31
36
 
32
- Sending that page to a printer is as easy as clicking "Print" from your browser. What comes out of your printer will have a 12 pt base font, normal margins, and a not-too-cramped baseline. (Ah the wonder of print stylesheets.)
37
+ Sending that page to a printer is as easy as clicking "Print" from your browser. What comes out of
38
+ your printer will have a 12 pt base font, normal margins, and a not-too-cramped baseline. (Ah the
39
+ wonder of print stylesheets.)
33
40
 
34
- You can throw as many files as you'd like in. Any commandline argument *not* preceded by an option (e.g., `--template`) or in the `mint` command vocabulary (more on that in a minute) will be interpreted as a file name:
41
+ You can throw as many files as you'd like in. Any commandline argument *not* preceded by an option
42
+ (e.g., `--template`) or in the `mint` command vocabulary (more on that in a minute) will be
43
+ interpreted as a file name:
35
44
 
36
- mint publish Minimalism.md Proposal.md Protocol.md
45
+ mint publish Document.md Proposal.md
37
46
 
38
47
  This command can be tweaked with options and arguments to be more flexible:
39
48
 
40
- mint publish Minimalism.md --template resume # specifies a style template
41
- mint publish Minimalism.md --destination final --style-destination=styles
49
+ mint publish Document.md --template resume # specifies a style template
50
+ mint publish Document.md --style-destination styles # creates external stylesheet in styles directory
51
+ mint publish Document.md --style-destination styles/custom.css # creates external stylesheet at specific path
42
52
 
43
- For a listing of mint options, take [a look at the API][API].
53
+ For a listing of mint options, take [a look at the tutorial][tutorial] or the [full API](http://www.rubydoc.info/github/davejacobs/mint).
44
54
 
45
- A basic Mint document
46
- ---------------------
55
+ ## A basic Mint document
47
56
 
48
- Mint is loaded with smart defaults, so if you don't want to configure something--say, the basic HTML skeleton of your document or the output directory--you don't have to. You'll probably be surprised at how easy it is to use out of the box, and how configurable it is.
57
+ Mint is loaded with smart defaults, so if you don't want to configure something--say, the basic HTML
58
+ skeleton of your document or the output directory--you don't have to. You'll probably be surprised
59
+ at how easy it is to use out of the box, and how configurable it is.
49
60
 
50
- document = Document.new "Minimalism.md"
61
+ document = Mint::Document.new("Document.md")
51
62
  document.publish!
52
63
 
53
- If you want to customize your document, though--and that's why I built this library--Mint makes that easy.
64
+ If you want to customize your document, though--and that's why I built this library--Mint makes that
65
+ easy with explicit parameters:
66
+
67
+ # Create a document with external stylesheet
68
+ document = Mint::Document.new("Document.md",
69
+ style_destination: "css",
70
+ template: "zen")
71
+ document.publish!
72
+
73
+ # Create with specific layout and style
74
+ document = Mint::Document.new("Resume.md",
75
+ destination: "output",
76
+ layout: "resume",
77
+ style: "professional")
78
+ document.publish!
54
79
 
55
80
  To understand Mint's flexibility, you'll want to [take a look at the API][API].
56
81
 
57
- [Firefox typography]: http://opentype.info/blog/2008/06/14/kerning-and-opentype-features-in-firefox-3/ "Firefox 3 supports kerning and automatic ligatures"
82
+ [Firefox typography]: http://opentype.info/blog/2008/06/14/kerning-and-opentype-features-in-firefox-3/ "Firefox 3 supports
83
+ kerning and automatic ligatures"
58
84
 
59
- Templates
60
- ---------
85
+ ## Templates
61
86
 
62
- Templates can be written in any format accepted by the Tilt template interface library. (See [the Tilt TEMPLATES file][Tilt templates] for more information.)
87
+ Templates can be written in any format accepted by the Tilt template interface library. (See [the
88
+ Tilt TEMPLATES file][Tilt templates] for more information.)
63
89
 
64
90
  In a template layouts, Ruby calls are sparse but necessary.
65
91
 
66
- If you're designing a layout, you need to indicate where Mint should place your content. For that simple reason, raw HTML files cannot be layouts. Instead, if you want to use HTML templates, you should use the ERB format. These files are essentially HTML with the possibility for Ruby calls. You can even use the .html extension for your files. Just code the dynamic portion using ERB syntax.
92
+ If you're designing a layout, you need to indicate where Mint should place your content. For that
93
+ simple reason, raw HTML files cannot be layouts. Instead, if you want to use HTML templates, you
94
+ should use the ERB format. These files are essentially HTML with the possibility for Ruby calls. You
95
+ can even use the .html extension for your files. Just code the dynamic portion using ERB syntax.
67
96
 
68
97
  Inside your template, use the `content` method to place your source's content.
69
98
 
70
- You will want to point to your document's stylesheet (via a relative URL) from within your layout, usually in the `<head/>` element. Use the `stylesheet` method.
99
+ For stylesheets, use the `stylesheet_tag` method, which automatically handles both inline and external stylesheets based on the document's style mode:
71
100
 
72
101
  So if you're writing your layout using Haml, the template might look like this:
73
102
 
74
- !!!
75
- %html
76
- %head
77
- %link(rel="stylesheet" href=stylesheet)
78
-
79
- %body
103
+ !!!
104
+ %html
105
+ %head
106
+ = stylesheet_tag
107
+ %body
80
108
  #container= content
81
109
 
82
- You can build stylesheets using [CSS][], [SASS/SCSS][] or [Less][]. They will always be compiled for you.
110
+ The `stylesheet_tag` method will generate either:
111
+ - `<style>...</style>` tags with inlined CSS for inline mode (default)
112
+ - `<link rel="stylesheet" href="...">` tags for external stylesheets
83
113
 
84
- Mint comes preloaded with several styles and layouts.
114
+ You can create template stylesheets using [CSS][] or [SCSS][].
115
+
116
+ Mint comes preloaded with a few templates to get you started.
85
117
 
86
118
  1. Default
87
119
  2. Zen
88
- 3. Resume\*
89
- 4. Protocol
90
- 5. Protocol Flow\* - requires Javascript and jQuery
91
-
92
- > Note: Starred entries are not yet implemented. If you have a killer
93
- > template you think should be included, send it my way. I'll check
94
- > it out and see if it should be part of the standard template library.
95
- > (Of course, you'll get all the credit.)
120
+ 3. Nord
121
+ 4. Nord Dark
96
122
 
97
- I've included a base stylesheet that is useful for setting sensible typographic defaults.
123
+ ## Plugins: A work in progress
98
124
 
99
- Plugins: A work in progress
100
- ---------------------------
125
+ I've designed the beginnings of a plugin system. With this system, you can implement a callback or
126
+ two and have full control over document creation and sharing. I'll get documentation going soon. For
127
+ now, look to lib/mint/plugins/epub.rb and bin/mint-epub for an example of how to build one. It's not
128
+ complete and I'm open to API suggestions.
101
129
 
102
- I've designed the beginnings of a plugin system. With this system, you can implement a callback or two and have full control over document creation and sharing. I'll get documentation going soon. For now, look to lib/mint/plugins/epub.rb and bin/mint-epub for an example of how to build one. It's not complete and I'm open to API suggestions.
130
+ This is going to be useful for things like creating actual office documents or e-books or even bound
131
+ novels. I'm actually thinking that half the power of this library is its plugin system.
103
132
 
104
- This is going to be useful for things like creating actual office documents or e-books or even bound novels. I'm actually thinking that half the power of this library is its plugin system.
105
-
106
- [API]: http://github.com/davejacobs/mint/tree/master/doc/API.md
133
+ [tutorial]: http://github.com/davejacobs/mint/tree/master/doc/API.md
107
134
  [Tilt templates]: http://github.com/rtomayko/tilt/blob/master/TEMPLATES.md "A listing of all templates supported by Tilt."
108
135
  [CSS]: http://en.wikipedia.org/wiki/Cascading_Style_Sheets
109
136
  [SASS/SCSS]: http://sass-lang.com/
110
- [Less]: http://lesscss.org/
111
-
137
+ [Less]: http://lesscss.org/
data/bin/mint CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
- # A script for harnessing Mint at the commandline
3
- # Usage: mint [command] [options] [files]
2
+
3
+ # Add /lib to path to override any local installations of Mint
4
+ $LOAD_PATH.unshift File.expand_path('../lib', __dir__)
4
5
 
5
6
  require "mint"
6
7
  require "shellwords"
@@ -8,7 +9,8 @@ require "shellwords"
8
9
  argv, commandline_options, help =
9
10
  Mint::CommandLine.parse(ARGV).values_at(:argv, :options, :help)
10
11
 
11
- case argv.shift.downcase.to_sym
12
+ original_command = argv.first
13
+ case (argv.shift || "help").downcase.to_sym
12
14
  when :publish
13
15
  # Aruba chokes here, so we use this hack to convince Mint we're
14
16
  # not in a pipeline
@@ -21,18 +23,46 @@ when :publish
21
23
  end
22
24
  end
23
25
  Mint::CommandLine.publish!(files, commandline_options)
26
+ when :preview
27
+ # Preview mode uses live CSS links instead of inline styles
28
+ Mint.rendering_mode = :preview
29
+ files =
30
+ if $stdin.tty? || ENV["MINT_NO_PIPE"]
31
+ argv
32
+ else
33
+ $stdin.each_line.reduce [] do |list, line|
34
+ list.concat(Shellwords.split(line))
35
+ end
36
+ end
37
+ Mint::CommandLine.publish!(files, commandline_options)
24
38
  when :help
25
39
  Mint::CommandLine.help(help)
26
40
  when :install
27
- Mint::CommandLine.install(argv.shift, commandline_options)
41
+ file = argv.shift
42
+ name = argv.shift
43
+ scope = commandline_options[:scope] || :local
44
+ Mint::CommandLine.install(file, name, scope)
28
45
  when :uninstall
29
- Mint::CommandLine.uninstall(argv.shift, commandline_options)
46
+ name = argv.shift
47
+ scope = commandline_options[:scope] || :local
48
+ Mint::CommandLine.uninstall(name, scope)
30
49
  when :templates
31
- Mint::CommandLine.templates(argv.shift, commandline_options)
32
- when :edit
33
- Mint::CommandLine.edit(argv.shift, commandline_options)
50
+ filter = argv.shift
51
+ scope = commandline_options[:scope] || :local
52
+ Mint::CommandLine.templates(filter, scope)
53
+ when :"edit-layout"
54
+ name = argv.shift
55
+ scope = commandline_options[:scope] || :local
56
+ Mint::CommandLine.edit(name, :layout, scope)
57
+ when :"edit-style"
58
+ name = argv.shift
59
+ scope = commandline_options[:scope] || :local
60
+ Mint::CommandLine.edit(name, :style, scope)
34
61
  when :set
35
- Mint::CommandLine.set(argv.shift, argv.shift, commandline_options)
62
+ key = argv.shift
63
+ value = argv.shift
64
+ scope = commandline_options[:scope] || :local
65
+ Mint::CommandLine.set(key, value, scope)
36
66
  when :config
37
67
  Mint::CommandLine.config
38
68
  else
@@ -43,8 +73,15 @@ else
43
73
  # document list.
44
74
 
45
75
  begin
46
- system 'mint-#{argv.first} #{argv[1..-1].join " "}'
76
+ if File.executable? "mint-#{original_command}"
77
+ system "mint-#{original_command} #{argv[1..-1].join ' '}"
78
+ else
79
+ $stderr.puts "Error: Unknown command '#{original_command}'"
80
+ Mint::CommandLine.help(help)
81
+ exit 1
82
+ end
47
83
  rescue
48
84
  Mint::CommandLine.help(help)
85
+ exit 1
49
86
  end
50
87
  end
data/bin/mint-epub CHANGED
@@ -3,13 +3,10 @@
3
3
  # A script for publishing Mint in the ePub format
4
4
  # Usage: mint epub [command] [options] [files]
5
5
 
6
+ $LOAD_PATH.unshift File.expand_path('../lib', __dir__)
6
7
  require "mint"
7
8
  require "mint/plugins/epub"
8
9
 
9
- # NOTE: This is not how I want this plugin to be called.
10
- # However, I do want a first iteration of the plugin
11
- # system on master, so we'll go with this for now.
12
-
13
10
  def usage
14
11
  abort "mint epub publish file"
15
12
  end
@@ -0,0 +1,187 @@
1
+ @import '../reset.css';
2
+
3
+ body {
4
+ font-family: var(--body-font-family), Georgia, serif;
5
+ }
6
+
7
+ h1, h2 {
8
+ line-height: 1.3;
9
+ }
10
+
11
+ h2, h3, h4, h5, h6 {
12
+ line-height: var(--screen-line-height);
13
+ }
14
+
15
+ h1, h2, h3, h4, h5, h6 {
16
+ font-family: var(--header-font-family);
17
+ font-weight: normal;
18
+ }
19
+
20
+ h1 {
21
+ font-size: calc(var(--screen-font-size) * 1.5);
22
+ margin-top: var(--screen-unit);
23
+ margin-bottom: var(--screen-unit);
24
+ }
25
+
26
+ h2 {
27
+ font-size: calc(var(--screen-font-size) * 1.2);
28
+ margin-top: calc(var(--screen-unit) * 3 / 2);
29
+ margin-bottom: calc(var(--screen-unit) * 1 / 2);
30
+ }
31
+
32
+ h3 {
33
+ font-size: calc(var(--screen-font-size) * 1.1);
34
+ margin-top: calc(var(--screen-unit) * 7 / 4);
35
+ margin-bottom: calc(var(--screen-unit) * 1 / 4);
36
+ }
37
+
38
+ h4 {
39
+ font-size: calc(var(--screen-font-size) * 1.05);
40
+ margin-top: calc(var(--screen-unit) * 7 / 8);
41
+ margin-bottom: calc(var(--screen-unit) * 1 / 8);
42
+ }
43
+
44
+ h5, h6 {
45
+ font-size: var(--screen-font-size);
46
+ margin-top: calc(var(--screen-unit) * 7 / 8);
47
+ margin-bottom: calc(var(--screen-unit) * 1 / 8);
48
+ }
49
+
50
+ ul {
51
+ list-style-type: square;
52
+ }
53
+
54
+ ul ul {
55
+ list-style-type: circle;
56
+ }
57
+
58
+ ul, ol {
59
+ margin: calc(var(--screen-unit) / 4) 0 0 calc(var(--screen-unit) / 2);
60
+ padding-left: calc(var(--screen-unit) * 1.2);
61
+ }
62
+
63
+ ul li p, ol li p {
64
+ text-indent: 0 !important;
65
+ }
66
+
67
+ ul li + li, ol li + li {
68
+ margin-top: calc(var(--screen-unit) / 4);
69
+ }
70
+
71
+ p {
72
+ margin: calc(var(--screen-unit) / 2) 0;
73
+ }
74
+
75
+ ul + p, ol + p, blockquote + p, pre + p {
76
+ text-indent: 0;
77
+ }
78
+
79
+ a:link, a:visited, a:active {
80
+ color: var(--link-color);
81
+ text-decoration: none;
82
+ }
83
+
84
+ a:hover {
85
+ text-decoration: underline;
86
+ }
87
+
88
+ code {
89
+ font-family: Monaco, Menlo, Mensch, Consolas, Monotype, mono;
90
+ font-style: normal;
91
+ }
92
+
93
+ pre {
94
+ display: block;
95
+ margin-left: var(--screen-unit);
96
+ margin-right: calc(var(--screen-unit) * 2);
97
+ padding: calc(var(--screen-unit) / 3) var(--screen-unit);
98
+ padding-left: calc(var(--screen-unit) * 3 / 4);
99
+ white-space: pre;
100
+ }
101
+
102
+ blockquote {
103
+ display: block;
104
+ margin-left: var(--screen-unit);
105
+ margin-right: calc(var(--screen-unit) * 2);
106
+ padding: calc(var(--screen-unit) / 3) var(--screen-unit);
107
+ padding-left: calc(var(--screen-unit) * 3 / 4);
108
+ }
109
+
110
+ pre p, blockquote p {
111
+ margin: 0;
112
+ line-height: 1.35;
113
+ }
114
+
115
+ img {
116
+ display: block;
117
+ }
118
+
119
+ @media screen {
120
+ body {
121
+ font-size: var(--screen-font-size);
122
+ line-height: var(--screen-line-height);
123
+ background-color: #666;
124
+ color: var(--text-color);
125
+ }
126
+
127
+ #container {
128
+ display: block;
129
+ border: solid 1px #999;
130
+ width: 780px;
131
+ padding: 40px 60px;
132
+ margin: calc(var(--screen-unit) / 2) auto;
133
+ background-color: #fff;
134
+ box-sizing: border-box;
135
+ -moz-box-sizing: border-box;
136
+ -webkit-box-sizing: border-box;
137
+ }
138
+
139
+ code {
140
+ font-size: calc(var(--screen-font-size) * 7 / 8);
141
+ }
142
+
143
+ pre {
144
+ white-space: pre-wrap;
145
+ white-space: -moz-pre-wrap;
146
+ white-space: -o-pre-wrap;
147
+ word-wrap: break-word;
148
+ }
149
+
150
+ pre code {
151
+ font-size: calc(var(--screen-font-size) * 3 / 4);
152
+ }
153
+ }
154
+
155
+ @media print {
156
+ @page {
157
+ margin-left: 1in;
158
+ margin-right: 1in;
159
+ margin-top: 1in;
160
+ margin-bottom: 1in;
161
+ }
162
+
163
+ body {
164
+ font-size: var(--print-font-size);
165
+ line-height: var(--print-line-height);
166
+ width: auto;
167
+ margin: 0;
168
+ padding: 0;
169
+ }
170
+
171
+ code {
172
+ font-size: calc(var(--print-font-size) * 7 / 8);
173
+ }
174
+
175
+ pre code {
176
+ font-size: calc(var(--print-font-size) * 3 / 4);
177
+ }
178
+
179
+ h1, h2, h3, h4, h5, h6, li, blockquote {
180
+ page-break-inside: avoid;
181
+ }
182
+
183
+ p {
184
+ widows: 3;
185
+ orphans: 3;
186
+ }
187
+ }