mint 0.8.0 → 0.10.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 (87) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -26
  3. data/README.md +138 -95
  4. data/bin/mint +2 -81
  5. data/config/templates/base/navigation.css +136 -0
  6. data/config/templates/base/print.css +152 -0
  7. data/config/templates/{reset.css → base/reset.css} +1 -1
  8. data/config/templates/base/style.css +117 -137
  9. data/config/templates/base/utilities.css +136 -0
  10. data/config/templates/base/variables.css +124 -0
  11. data/config/templates/basic/style.css +151 -0
  12. data/config/templates/default/layout.erb +33 -3
  13. data/config/templates/default/style.css +95 -164
  14. data/config/templates/magazine/style.css +383 -0
  15. data/config/templates/nord/style.css +105 -220
  16. data/config/templates/nord-dark/style.css +82 -263
  17. data/lib/mint/commandline/parse.rb +144 -0
  18. data/lib/mint/commandline/publish.rb +46 -0
  19. data/lib/mint/commandline/run.rb +30 -0
  20. data/lib/mint/config.rb +162 -0
  21. data/lib/mint/{css.rb → css_dsl.rb} +9 -9
  22. data/lib/mint/css_parser.rb +96 -0
  23. data/lib/mint/document.rb +251 -348
  24. data/lib/mint/document_tree.rb +163 -0
  25. data/lib/mint/exceptions.rb +2 -3
  26. data/lib/mint/helpers.rb +23 -180
  27. data/lib/mint/layout.rb +26 -9
  28. data/lib/mint/renderers/css_renderer.rb +32 -0
  29. data/lib/mint/renderers/erb_renderer.rb +11 -0
  30. data/lib/mint/renderers/markdown_renderer.rb +45 -0
  31. data/lib/mint/style.rb +21 -31
  32. data/lib/mint/template.rb +30 -0
  33. data/lib/mint/version.rb +1 -1
  34. data/lib/mint/workspace.rb +171 -0
  35. data/lib/mint.rb +44 -12
  36. data/man/mint.1 +88 -47
  37. data/spec/cli/README.md +13 -13
  38. data/spec/cli/argument_parsing_spec.rb +103 -131
  39. data/spec/cli/bin_integration_spec.rb +23 -243
  40. data/spec/cli/full_workflow_integration_spec.rb +99 -442
  41. data/spec/cli/original_style_integration_spec.rb +58 -0
  42. data/spec/cli/publish_workflow_spec.rb +72 -70
  43. data/spec/commandline_path_integration_spec.rb +230 -0
  44. data/spec/config_file_integration_spec.rb +362 -0
  45. data/spec/{css_spec.rb → css_dsl_spec.rb} +7 -3
  46. data/spec/css_parser_spec.rb +207 -0
  47. data/spec/document_spec.rb +37 -242
  48. data/spec/flattened_path_spec.rb +150 -0
  49. data/spec/layout_spec.rb +42 -3
  50. data/spec/mint_spec.rb +22 -217
  51. data/spec/path_handling_spec.rb +237 -0
  52. data/spec/run_cli_tests.rb +1 -1
  53. data/spec/spec_helper.rb +3 -10
  54. data/spec/style_spec.rb +31 -56
  55. data/spec/support/cli_helpers.rb +7 -10
  56. data/spec/support/matchers.rb +1 -1
  57. data/spec/template_spec.rb +31 -0
  58. data/spec/workspace_spec.rb +177 -0
  59. metadata +78 -93
  60. data/bin/mint-epub +0 -20
  61. data/config/templates/default/css/style.css +0 -205
  62. data/config/templates/garden/layout.erb +0 -38
  63. data/config/templates/garden/style.css +0 -303
  64. data/config/templates/newspaper/layout.erb +0 -16
  65. data/config/templates/nord/layout.erb +0 -11
  66. data/config/templates/nord-dark/layout.erb +0 -11
  67. data/config/templates/protocol/layout.erb +0 -9
  68. data/config/templates/protocol/style.css +0 -25
  69. data/config/templates/zen/layout.erb +0 -11
  70. data/config/templates/zen/style.css +0 -114
  71. data/lib/mint/command_line.rb +0 -360
  72. data/lib/mint/css_template.rb +0 -37
  73. data/lib/mint/markdown_template.rb +0 -47
  74. data/lib/mint/mint.rb +0 -313
  75. data/lib/mint/plugin.rb +0 -136
  76. data/lib/mint/plugins/epub.rb +0 -293
  77. data/lib/mint/resource.rb +0 -101
  78. data/plugins/templates/epub/layouts/container.haml +0 -5
  79. data/plugins/templates/epub/layouts/content.haml +0 -35
  80. data/plugins/templates/epub/layouts/layout.haml +0 -6
  81. data/plugins/templates/epub/layouts/title.haml +0 -11
  82. data/plugins/templates/epub/layouts/toc.haml +0 -26
  83. data/spec/cli/configuration_management_spec.rb +0 -363
  84. data/spec/cli/template_management_spec.rb +0 -300
  85. data/spec/helpers_spec.rb +0 -249
  86. data/spec/plugin_spec.rb +0 -449
  87. data/spec/resource_spec.rb +0 -135
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 70a879d8b2c0b7150b6535b2c2c00c366d3e8484c499c7c0065e76bd5454b768
4
- data.tar.gz: a2595df94714597a9937a232115b963c096b6b71acbe373878a700181653adb4
3
+ metadata.gz: 49ea6b9145cae1e2d818755c3e58b4e4188bfc67a64f4a21920618a49dff5ff8
4
+ data.tar.gz: f87f2f93b543033c511616c846bf7a29162adced84bca4442702f0e7f1f903ff
5
5
  SHA512:
6
- metadata.gz: 1ca15ee5ad05556ca6d7aef47d2f74f048a2f2cd7c11fc78931ffd6af7a36417dc65c04dae0661b53a71c9515dcdef09557d7538e0607da161a424061e3049f6
7
- data.tar.gz: 4d2b342e58022fde932ad266825bfed9d2b08ba029c0b0469868560a7d87e69383d8c0eab5fa3b28e63630283a33e808cb6319fd4ae9f0bc9734ca93dbea2598
6
+ metadata.gz: 4388535cb5372e7ef4448ed7ce10e1cd82a807803656772005e8356fafe7015f9a504c1cd6580f8e701cc36714e9d06fc0e2e46310dddfdd0997714324c2611a
7
+ data.tar.gz: 02da67bfde18bf22c7639a5b653ebd5e4d4af3da208b54e0e0501c99572f786e537839012302c7c4c529c932f12ba9a84f26215ee9b30921df403b510b5fa47d
data/Gemfile CHANGED
@@ -1,27 +1,2 @@
1
1
  source "https://rubygems.org"
2
-
3
- # General
4
- gem "rubyzip", "~> 3.0", ">= 3.0.1"
5
- gem "hashie", "~> 5.0"
6
- gem "nokogiri", "1.15.5"
7
-
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'
14
-
15
- # Helpers
16
- gem "activesupport", "~> 8.0", ">= 8.0.2.1"
17
-
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
2
+ gemspec
data/README.md CHANGED
@@ -1,137 +1,180 @@
1
- # What is Mint?
1
+ # Mint
2
2
 
3
- Mint transforms your plain text documents into beautiful documents. It makes the process simple but customizable.
3
+ Transform your plain text documents into beautiful HTML documents with customizable styling and templates.
4
4
 
5
- Why would you want to keep all of your documents as plain text?
5
+ ![Status](https://github.com/davejacobs/mint/actions/workflows/build.yml/badge.svg)
6
6
 
7
- - To focus on words and structure when you write
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
7
+ ## Why Mint?
11
8
 
12
- What does Mint create from these source files? Beautiful, styled HTML ready to print, e-mail, export, and present.
9
+ - **Focus on writing** Keep documents as plain text
10
+ - **Beautiful output** – Professional-looking HTML ready for print or web
11
+ - **Digital gardens** – Easily publish linked sets of HTML documents from tools like Obsidian
12
+ - **Version control-friendly** – Text documents work great with Git
13
+ - **Scriptable** – Automate document processing and analysis
14
+ - **Highly customizable** – Create your own templates and styles
13
15
 
14
- In a few words: *Mint processes words so you don't have to.*
16
+ ## Installation
15
17
 
16
- ## The mint command
18
+ ```bash
19
+ gem install mint
20
+ ```
17
21
 
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.
22
+ ## Documentation
20
23
 
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.
24
+ - **Complete usage guide:** [TUTORIAL.md](doc/TUTORIAL.md)
25
+ - **Man page:** `man mint`
26
+ - **API documentation:** [RubyDoc](http://www.rubydoc.info/github/davejacobs/mint)
23
27
 
24
- Simply type:
28
+ ## Get started
25
29
 
26
- mint publish Document.md
30
+ Transform a Markdown document into styled HTML:
27
31
 
28
- And voilà, Minimalism.html will show up next to Document.md.
32
+ ```bash
33
+ mint publish Document.md
34
+ ```
29
35
 
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.
36
+ This creates `Document.html` in your current directory with beautiful default styling. The styles
37
+ are inlined by default, so you can send your document to anyone you'd like, and they'll see the
38
+ same thing.
36
39
 
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.)
40
+ ## Usage
40
41
 
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:
42
+ ### Basic commands
44
43
 
45
- mint publish Document.md Proposal.md
44
+ ```bash
45
+ # Publish a single document with a default template
46
+ mint publish Document.md
46
47
 
47
- This command can be tweaked with options and arguments to be more flexible:
48
+ # Publish with a non-default template
49
+ mint publish Document.md --template nord
48
50
 
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
51
+ # Publish to a specific directory
52
+ mint publish Document.md --destination public
52
53
 
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).
54
+ # Publish multiple files
55
+ mint publish *.md --destination final-drafts
54
56
 
55
- ## A basic Mint document
57
+ # Read Markdown content piped from STDIN, limited to a single file; note the `-`
58
+ # as a special filename
59
+ echo "# Document" | mint publish - --output-file Document.html
56
60
 
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.
61
+ # Publish multiple files and generate a left-hand navigation panel; use globs
62
+ # to recursively include nested files. By default, nested directories will
63
+ # be preserved, but any common directories for all files (in this case, `content`),
64
+ # will be automatically removed from the output ("autodropped").
65
+ mint publish content/**/*.md --destination public --navigation --navigation-title "Documentation"
60
66
 
61
- document = Mint::Document.new("Document.md")
62
- document.publish!
67
+ # Guess document title (and h1 header) from filename
68
+ mint publish Document.md --file-title
69
+ ```
63
70
 
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:
71
+ ### Common options
66
72
 
67
- # Create a document with external stylesheet
68
- document = Mint::Document.new("Document.md",
69
- style_destination: "css",
70
- template: "zen")
71
- document.publish!
73
+ | Flag | Description |
74
+ |------|-------------|
75
+ | `-t, --template TEMPLATE` | Use a built-in template (combines layout + style) |
76
+ | `-l, --layout LAYOUT` | Specify only the template layout, by name |
77
+ | `-s, --style STYLE` | Specify only the template style, by name |
78
+ | `-m, --style-mode MODE` | How styles are included (inline, external, original) |
79
+ | `-d, --destination DIR` | Output directory |
80
+ | `-o, --output-file FORMAT` | Custom output filename, with substitutions available |
81
+ | `--no-autodrop` | Do not automatically drop common parent directories from published files |
82
+ | `--no-preserve-structure` | Flatten all published files into one directory rather than preserving structure |
83
+ | `--file-title` | Extract title from filename and inject into template |
84
+ | `--navigation` | Enable navigation panel showing all files |
85
+ | `--navigation-title TITLE` | Set title for navigation panel |
86
+ | `--navigation-depth N` | Maximum depth to show in navigation after dropping levels (default: 3) |
87
+ | `-v, --verbose` | Show where documents were published |
72
88
 
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!
89
+ ### Built-in templates
79
90
 
80
- To understand Mint's flexibility, you'll want to [take a look at the API][API].
91
+ - `default` Clean, centered, modern layout
92
+ - `basic` – Clean, minimal styling, focuses on text
93
+ - `nord` – Clean, uses Nord color scheme and sans text
94
+ - `nord-dark` – Dark version of Nord
95
+ - `magazine` – Refined & easy to adapt for publications
81
96
 
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"
97
+ ### Custom templates
84
98
 
85
- ## Templates
99
+ It's easy to write a custom template: simply create a directory in `~/.config/mint/templates` or `./mint/templates`
100
+ with the name of your new template. Create a `style.css` file and an optional `layout.html` file (which uses ERB
101
+ to include variables like the document title and body). If you opt not to create a new `layout.html`, the
102
+ layout from the default template will be used.
86
103
 
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.)
104
+ Mint layouts are written in ERB-flavored HTML, and stylesheets are written in CSS.
89
105
 
90
- In a template layouts, Ruby calls are sparse but necessary.
106
+ ## Configuration
91
107
 
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.
108
+ Mint can be configured using TOML configuration files that specify defaults for commandline options.
109
+ Configuration options are loaded in the following order (later files override earlier ones):
96
110
 
97
- Inside your template, use the `content` method to place your source's content.
111
+ 1. **Global**: Built-in defaults
112
+ 2. **User**: `~/.config/mint/config.toml`
113
+ 3. **Local**: `.mint/config.toml`
114
+ 4. **Commandline**: Explicit flags override any other configuration
98
115
 
99
- For stylesheets, use the `stylesheet_tag` method, which automatically handles both inline and external stylesheets based on the document's style mode:
116
+ ### Example configuration file
100
117
 
101
- So if you're writing your layout using Haml, the template might look like this:
118
+ Create `.mint/config.toml` in your project directory:
102
119
 
103
- !!!
104
- %html
105
- %head
106
- = stylesheet_tag
107
- %body
108
- #container= content
120
+ ```toml
121
+ # Template and styling
122
+ template = "nord"
109
123
 
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
124
+ # File output handling
125
+ destination = "public"
126
+ preserve-structure = true
127
+ output-file = "%{basename}_processed.%{new_extension}"
128
+ style-mode = "external"
113
129
 
114
- You can create template stylesheets using [CSS][] or [SCSS][].
130
+ # Navigation
131
+ navigation = true
132
+ navigation-title = "My Docs"
133
+ navigation-autodrop = true # Automatically drop common directory levels (default: true)
134
+ navigation-depth = 3 # Maximum depth after dropping levels (default: 3)
135
+ navigation-drop = 1 # Alternative to autodrop - manually specify levels to drop
115
136
 
116
- Mint comes preloaded with a few templates to get you started.
137
+ # Other options
138
+ file-title = true
139
+ working-dir = "/path/to/source"
140
+ ```
117
141
 
118
- 1. Default
119
- 2. Zen
120
- 3. Nord
121
- 4. Nord Dark
142
+ ### Overriding configuration file settings
122
143
 
123
- ## Plugins: A work in progress
144
+ For most flags, overriding your configuration file is simple: You can simply
145
+ specify a new value via commandline flags. Boolean flags require a slightly
146
+ different approach, the use of `--no-[option]` flags.
124
147
 
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.
148
+ If you've set `navigation = true` in `config.toml`, you can override that
149
+ at the commandline:
129
150
 
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.
151
+ ```bash
152
+ mint publish docs.md --no-navigation
153
+ ```
132
154
 
133
- [tutorial]: http://github.com/davejacobs/mint/tree/master/doc/API.md
134
- [Tilt templates]: http://github.com/rtomayko/tilt/blob/master/TEMPLATES.md "A listing of all templates supported by Tilt."
135
- [CSS]: http://en.wikipedia.org/wiki/Cascading_Style_Sheets
136
- [SASS/SCSS]: http://sass-lang.com/
137
- [Less]: http://lesscss.org/
155
+ Available `--no-` flags:
156
+ - `--no-preserve-structure` - Don't preserve directory structure
157
+ - `--no-navigation` - Disable navigation panel
158
+ - `--no-file-title` - Don't extract titles from filenames
159
+
160
+ ### Style modes
161
+
162
+ Mint offers three ways to include styles in your HTML output:
163
+
164
+ - `inline` (default) – CSS is embedded directly in the HTML document as `<style>` tags
165
+ - `external` – CSS is compiled and saved as separate files, linked with `<link>` tags
166
+ - `original` – Links directly to original CSS template files without processing (for live editing)
167
+
168
+ The `original` mode is particularly useful for template development, as it allows you to edit CSS files and see changes immediately without republishing. Only `.css` files are supported in this mode, and `@import` statements in CSS files will be included as additional `<link>` tags.
169
+
170
+ ## Contributing
171
+
172
+ 1. Fork the repository
173
+ 2. Create a feature branch
174
+ 3. Make your changes
175
+ 4. Run the tests: `rspec`
176
+ 5. Submit a pull request
177
+
178
+ ## License
179
+
180
+ MIT License. See [LICENSE](LICENSE) for details.
data/bin/mint CHANGED
@@ -1,87 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- # Add /lib to path to override any local installations of Mint
3
+ # Override any local installations of Mint
4
4
  $LOAD_PATH.unshift File.expand_path('../lib', __dir__)
5
5
 
6
6
  require "mint"
7
- require "shellwords"
8
7
 
9
- argv, commandline_options, help =
10
- Mint::CommandLine.parse(ARGV).values_at(:argv, :options, :help)
11
-
12
- original_command = argv.first
13
- case (argv.shift || "help").downcase.to_sym
14
- when :publish
15
- # Aruba chokes here, so we use this hack to convince Mint we're
16
- # not in a pipeline
17
- files =
18
- if $stdin.tty? || ENV["MINT_NO_PIPE"]
19
- argv
20
- else
21
- $stdin.each_line.reduce [] do |list, line|
22
- list.concat(Shellwords.split(line))
23
- end
24
- end
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)
38
- when :help
39
- Mint::CommandLine.help(help)
40
- when :install
41
- file = argv.shift
42
- name = argv.shift
43
- scope = commandline_options[:scope] || :local
44
- Mint::CommandLine.install(file, name, scope)
45
- when :uninstall
46
- name = argv.shift
47
- scope = commandline_options[:scope] || :local
48
- Mint::CommandLine.uninstall(name, scope)
49
- when :templates
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)
61
- when :set
62
- key = argv.shift
63
- value = argv.shift
64
- scope = commandline_options[:scope] || :local
65
- Mint::CommandLine.set(key, value, scope)
66
- when :config
67
- Mint::CommandLine.config
68
- else
69
- # If no commands were found, search the PATH for commands prefixed
70
- # with mint-. If no matching executables are found, we know we've
71
- # been passed a set of documents, so parse the commandline options,
72
- # merge them with the config options, and start minting the
73
- # document list.
74
-
75
- begin
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
83
- rescue
84
- Mint::CommandLine.help(help)
85
- exit 1
86
- end
87
- end
8
+ Mint::Commandline.run!(ARGV)
@@ -0,0 +1,136 @@
1
+ /* Base Navigation Layout - Structural styles only */
2
+ /* Colors, fonts, and borders should be overridden in individual templates */
3
+
4
+ /* Navigation container positioning and dimensions */
5
+ #navigation {
6
+ position: fixed;
7
+ left: 0;
8
+ top: 0;
9
+ width: var(--navigation-width);
10
+ height: 100vh;
11
+ overflow-y: auto;
12
+ padding: var(--space-base) 0;
13
+ z-index: var(--z-navigation);
14
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
15
+ font-weight: 400;
16
+ background-color: var(--color-nav-bg);
17
+ border-right: 1px solid var(--color-nav-border);
18
+ }
19
+
20
+ /* Navigation header */
21
+ #navigation h3 {
22
+ margin: 0 0 var(--space-sm) 0;
23
+ padding: 0 var(--space-base);
24
+ font-size: var(--font-size-sm);
25
+ font-weight: 600;
26
+ color: var(--color-nav-text);
27
+ }
28
+
29
+ /* Navigation list structure */
30
+ #navigation ul {
31
+ list-style: none;
32
+ padding: 0;
33
+ margin: 0;
34
+ }
35
+
36
+ #navigation li {
37
+ margin: 0;
38
+ }
39
+
40
+ /* Navigation links layout */
41
+ #navigation a {
42
+ display: block;
43
+ padding: var(--space-xs) var(--space-base);
44
+ text-decoration: none;
45
+ border-left: 2px solid transparent;
46
+ border-bottom: none;
47
+ transition: var(--transition-fast);
48
+ font-weight: 400;
49
+ color: var(--color-nav-text);
50
+ font-size: var(--font-size-sm);
51
+ }
52
+
53
+ #navigation a:hover {
54
+ color: var(--color-nav-text-hover);
55
+ background-color: var(--color-nav-bg-hover);
56
+ border-left-color: var(--color-nav-border);
57
+ }
58
+
59
+ #navigation a.current {
60
+ color: var(--color-nav-text-active);
61
+ background-color: var(--color-nav-bg-active);
62
+ border-left-color: var(--color-nav-border-active);
63
+ font-weight: 500;
64
+ }
65
+
66
+ /* Directory names (non-clickable) */
67
+ #navigation .directory-name {
68
+ display: block;
69
+ padding: var(--space-xs) var(--space-base);
70
+ font-weight: 600;
71
+ color: var(--color-nav-text-hover);
72
+ font-size: var(--font-size-xs);
73
+ }
74
+
75
+ /* Depth-based indentation */
76
+ #navigation .depth-0 a,
77
+ #navigation .depth-0 .directory-name {
78
+ padding-left: var(--space-base);
79
+ }
80
+
81
+ #navigation .depth-1 a,
82
+ #navigation .depth-1 .directory-name {
83
+ padding-left: calc(var(--space-base) * 2);
84
+ }
85
+
86
+ #navigation .depth-2 a,
87
+ #navigation .depth-2 .directory-name {
88
+ padding-left: calc(var(--space-base) * 3);
89
+ }
90
+
91
+ #navigation .depth-3 a,
92
+ #navigation .depth-3 .directory-name {
93
+ padding-left: calc(var(--space-base) * 4);
94
+ }
95
+
96
+ /* Container adjustments when navigation is present */
97
+ body:has(#navigation) #container {
98
+ margin-left: var(--navigation-width);
99
+ padding-left: var(--navigation-gap);
100
+ }
101
+
102
+ /* Fallback for browsers that don't support :has() */
103
+ @supports not selector(:has(#navigation)) {
104
+ body.has-navigation #container {
105
+ margin-left: var(--navigation-width);
106
+ padding-left: var(--navigation-gap);
107
+ }
108
+ }
109
+
110
+ /* Responsive navigation */
111
+ @media (max-width: 960px) {
112
+ #navigation {
113
+ position: static;
114
+ width: 100%;
115
+ height: auto;
116
+ border-right: none;
117
+ padding: var(--space-sm) 0;
118
+ }
119
+
120
+ body:has(#navigation) #container,
121
+ body.has-navigation #container {
122
+ margin-left: auto;
123
+ }
124
+ }
125
+
126
+ /* Hide navigation in print */
127
+ @media print {
128
+ #navigation {
129
+ display: none !important;
130
+ }
131
+
132
+ body:has(#navigation) #container,
133
+ body.has-navigation #container {
134
+ margin-left: auto !important;
135
+ }
136
+ }