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.
- checksums.yaml +4 -4
- data/Gemfile +1 -26
- data/README.md +138 -95
- data/bin/mint +2 -81
- data/config/templates/base/navigation.css +136 -0
- data/config/templates/base/print.css +152 -0
- data/config/templates/{reset.css → base/reset.css} +1 -1
- data/config/templates/base/style.css +117 -137
- data/config/templates/base/utilities.css +136 -0
- data/config/templates/base/variables.css +124 -0
- data/config/templates/basic/style.css +151 -0
- data/config/templates/default/layout.erb +33 -3
- data/config/templates/default/style.css +95 -164
- data/config/templates/magazine/style.css +383 -0
- data/config/templates/nord/style.css +105 -220
- data/config/templates/nord-dark/style.css +82 -263
- data/lib/mint/commandline/parse.rb +144 -0
- data/lib/mint/commandline/publish.rb +46 -0
- data/lib/mint/commandline/run.rb +30 -0
- data/lib/mint/config.rb +162 -0
- data/lib/mint/{css.rb → css_dsl.rb} +9 -9
- data/lib/mint/css_parser.rb +96 -0
- data/lib/mint/document.rb +251 -348
- data/lib/mint/document_tree.rb +163 -0
- data/lib/mint/exceptions.rb +2 -3
- data/lib/mint/helpers.rb +23 -180
- data/lib/mint/layout.rb +26 -9
- data/lib/mint/renderers/css_renderer.rb +32 -0
- data/lib/mint/renderers/erb_renderer.rb +11 -0
- data/lib/mint/renderers/markdown_renderer.rb +45 -0
- data/lib/mint/style.rb +21 -31
- data/lib/mint/template.rb +30 -0
- data/lib/mint/version.rb +1 -1
- data/lib/mint/workspace.rb +171 -0
- data/lib/mint.rb +44 -12
- data/man/mint.1 +88 -47
- data/spec/cli/README.md +13 -13
- data/spec/cli/argument_parsing_spec.rb +103 -131
- data/spec/cli/bin_integration_spec.rb +23 -243
- data/spec/cli/full_workflow_integration_spec.rb +99 -442
- data/spec/cli/original_style_integration_spec.rb +58 -0
- data/spec/cli/publish_workflow_spec.rb +72 -70
- data/spec/commandline_path_integration_spec.rb +230 -0
- data/spec/config_file_integration_spec.rb +362 -0
- data/spec/{css_spec.rb → css_dsl_spec.rb} +7 -3
- data/spec/css_parser_spec.rb +207 -0
- data/spec/document_spec.rb +37 -242
- data/spec/flattened_path_spec.rb +150 -0
- data/spec/layout_spec.rb +42 -3
- data/spec/mint_spec.rb +22 -217
- data/spec/path_handling_spec.rb +237 -0
- data/spec/run_cli_tests.rb +1 -1
- data/spec/spec_helper.rb +3 -10
- data/spec/style_spec.rb +31 -56
- data/spec/support/cli_helpers.rb +7 -10
- data/spec/support/matchers.rb +1 -1
- data/spec/template_spec.rb +31 -0
- data/spec/workspace_spec.rb +177 -0
- metadata +78 -93
- data/bin/mint-epub +0 -20
- data/config/templates/default/css/style.css +0 -205
- data/config/templates/garden/layout.erb +0 -38
- data/config/templates/garden/style.css +0 -303
- data/config/templates/newspaper/layout.erb +0 -16
- data/config/templates/nord/layout.erb +0 -11
- data/config/templates/nord-dark/layout.erb +0 -11
- data/config/templates/protocol/layout.erb +0 -9
- data/config/templates/protocol/style.css +0 -25
- data/config/templates/zen/layout.erb +0 -11
- data/config/templates/zen/style.css +0 -114
- data/lib/mint/command_line.rb +0 -360
- data/lib/mint/css_template.rb +0 -37
- data/lib/mint/markdown_template.rb +0 -47
- data/lib/mint/mint.rb +0 -313
- data/lib/mint/plugin.rb +0 -136
- data/lib/mint/plugins/epub.rb +0 -293
- data/lib/mint/resource.rb +0 -101
- data/plugins/templates/epub/layouts/container.haml +0 -5
- data/plugins/templates/epub/layouts/content.haml +0 -35
- data/plugins/templates/epub/layouts/layout.haml +0 -6
- data/plugins/templates/epub/layouts/title.haml +0 -11
- data/plugins/templates/epub/layouts/toc.haml +0 -26
- data/spec/cli/configuration_management_spec.rb +0 -363
- data/spec/cli/template_management_spec.rb +0 -300
- data/spec/helpers_spec.rb +0 -249
- data/spec/plugin_spec.rb +0 -449
- data/spec/resource_spec.rb +0 -135
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49ea6b9145cae1e2d818755c3e58b4e4188bfc67a64f4a21920618a49dff5ff8
|
4
|
+
data.tar.gz: f87f2f93b543033c511616c846bf7a29162adced84bca4442702f0e7f1f903ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
#
|
1
|
+
# Mint
|
2
2
|
|
3
|
-
|
3
|
+
Transform your plain text documents into beautiful HTML documents with customizable styling and templates.
|
4
4
|
|
5
|
-
|
5
|
+

|
6
6
|
|
7
|
-
|
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
|
-
|
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
|
-
|
16
|
+
## Installation
|
15
17
|
|
16
|
-
|
18
|
+
```bash
|
19
|
+
gem install mint
|
20
|
+
```
|
17
21
|
|
18
|
-
|
19
|
-
language, you're ready to go.
|
22
|
+
## Documentation
|
20
23
|
|
21
|
-
|
22
|
-
|
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
|
-
|
28
|
+
## Get started
|
25
29
|
|
26
|
-
|
30
|
+
Transform a Markdown document into styled HTML:
|
27
31
|
|
28
|
-
|
32
|
+
```bash
|
33
|
+
mint publish Document.md
|
34
|
+
```
|
29
35
|
|
30
|
-
|
31
|
-
|
32
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
44
|
+
```bash
|
45
|
+
# Publish a single document with a default template
|
46
|
+
mint publish Document.md
|
46
47
|
|
47
|
-
|
48
|
+
# Publish with a non-default template
|
49
|
+
mint publish Document.md --template nord
|
48
50
|
|
49
|
-
|
50
|
-
|
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
|
-
|
54
|
+
# Publish multiple files
|
55
|
+
mint publish *.md --destination final-drafts
|
54
56
|
|
55
|
-
|
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
|
-
|
58
|
-
|
59
|
-
|
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
|
-
|
62
|
-
|
67
|
+
# Guess document title (and h1 header) from filename
|
68
|
+
mint publish Document.md --file-title
|
69
|
+
```
|
63
70
|
|
64
|
-
|
65
|
-
easy with explicit parameters:
|
71
|
+
### Common options
|
66
72
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
83
|
-
kerning and automatic ligatures"
|
97
|
+
### Custom templates
|
84
98
|
|
85
|
-
|
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
|
-
|
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
|
-
|
106
|
+
## Configuration
|
91
107
|
|
92
|
-
|
93
|
-
|
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
|
-
|
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
|
-
|
116
|
+
### Example configuration file
|
100
117
|
|
101
|
-
|
118
|
+
Create `.mint/config.toml` in your project directory:
|
102
119
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
= stylesheet_tag
|
107
|
-
%body
|
108
|
-
#container= content
|
120
|
+
```toml
|
121
|
+
# Template and styling
|
122
|
+
template = "nord"
|
109
123
|
|
110
|
-
|
111
|
-
|
112
|
-
-
|
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
|
-
|
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
|
-
|
137
|
+
# Other options
|
138
|
+
file-title = true
|
139
|
+
working-dir = "/path/to/source"
|
140
|
+
```
|
117
141
|
|
118
|
-
|
119
|
-
2. Zen
|
120
|
-
3. Nord
|
121
|
-
4. Nord Dark
|
142
|
+
### Overriding configuration file settings
|
122
143
|
|
123
|
-
|
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
|
-
|
126
|
-
|
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
|
-
|
131
|
-
|
151
|
+
```bash
|
152
|
+
mint publish docs.md --no-navigation
|
153
|
+
```
|
132
154
|
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
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
|
-
#
|
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
|
-
|
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
|
+
}
|