Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f66f14b593 | |||
| 8a52315dee | |||
| 7c4052906c | |||
| 3a56f39f6a | |||
| 6585ca5dd0 | |||
| 792abae07e | |||
| 74ce648c59 |
@@ -534,7 +534,15 @@ Note that filenames on windows must not contain any of the following characters
|
|||||||
|
|
||||||
## CONFIG FILE
|
## CONFIG FILE
|
||||||
|
|
||||||
Gollum optionaly takes a `--config file`. See [config.rb](https://github.com/github/gollum/blob/master/config.rb) for an example.
|
Gollum optionally takes a `--config file`. See [config.rb](https://github.com/github/gollum/blob/master/config.rb) for an example.
|
||||||
|
|
||||||
|
## CUSTOM CSS
|
||||||
|
|
||||||
|
The `--css` flag will inject `custom.css` from the root of your git repository into each page. Here's an example of floating the sidebar to the left.
|
||||||
|
|
||||||
|
```css
|
||||||
|
#wiki-rightbar { float: left !important; }
|
||||||
|
```
|
||||||
|
|
||||||
## CONTRIBUTE
|
## CONTRIBUTE
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,10 @@ opts = OptionParser.new do |opts|
|
|||||||
options['irb'] = true
|
options['irb'] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
opts.on("--css", "Inject custom css. Uses custom.css from root repository") do
|
||||||
|
wiki_options[:css] = true
|
||||||
|
end
|
||||||
|
|
||||||
opts.on("--page-file-dir [PATH]", "Specify the sub directory for all page files (default: repository root).") do |path|
|
opts.on("--page-file-dir [PATH]", "Specify the sub directory for all page files (default: repository root).") do |path|
|
||||||
wiki_options[:page_file_dir] = path
|
wiki_options[:page_file_dir] = path
|
||||||
end
|
end
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ Gem::Specification.new do |s|
|
|||||||
s.required_ruby_version = ">= 1.8.7"
|
s.required_ruby_version = ">= 1.8.7"
|
||||||
|
|
||||||
s.name = 'gollum'
|
s.name = 'gollum'
|
||||||
s.version = '2.3.8'
|
s.version = '2.3.10'
|
||||||
s.date = '2012-11-07'
|
s.date = '2012-11-07'
|
||||||
s.rubyforge_project = 'gollum'
|
s.rubyforge_project = 'gollum'
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ require File.expand_path('../gollum/web_sequence_diagram', __FILE__)
|
|||||||
require File.expand_path('../gollum/frontend/uri_encode_component', __FILE__)
|
require File.expand_path('../gollum/frontend/uri_encode_component', __FILE__)
|
||||||
|
|
||||||
module Gollum
|
module Gollum
|
||||||
VERSION = '2.3.8'
|
VERSION = '2.3.10'
|
||||||
|
|
||||||
def self.assets_path
|
def self.assets_path
|
||||||
::File.expand_path('gollum/frontend/public', ::File.dirname(__FILE__))
|
::File.expand_path('gollum/frontend/public', ::File.dirname(__FILE__))
|
||||||
|
|||||||
@@ -238,6 +238,7 @@ module Precious
|
|||||||
@content = @page.formatted_data
|
@content = @page.formatted_data
|
||||||
@toc_content = wiki.universal_toc ? @page.toc_data : nil
|
@toc_content = wiki.universal_toc ? @page.toc_data : nil
|
||||||
@mathjax = wiki.mathjax
|
@mathjax = wiki.mathjax
|
||||||
|
@css = wiki.css
|
||||||
@editable = false
|
@editable = false
|
||||||
mustache :page
|
mustache :page
|
||||||
end
|
end
|
||||||
@@ -360,6 +361,7 @@ module Precious
|
|||||||
@content = page.formatted_data
|
@content = page.formatted_data
|
||||||
@toc_content = wiki.universal_toc ? @page.toc_data : nil
|
@toc_content = wiki.universal_toc ? @page.toc_data : nil
|
||||||
@mathjax = wiki.mathjax
|
@mathjax = wiki.mathjax
|
||||||
|
@css = wiki.css
|
||||||
mustache :page
|
mustache :page
|
||||||
elsif file = wiki.file(fullpath)
|
elsif file = wiki.file(fullpath)
|
||||||
content_type file.mime_type
|
content_type file.mime_type
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
<link rel="stylesheet" type="text/css" href="{{base_url}}/css/editor.css" media="all">
|
<link rel="stylesheet" type="text/css" href="{{base_url}}/css/editor.css" media="all">
|
||||||
<link rel="stylesheet" type="text/css" href="{{base_url}}/css/dialog.css" media="all">
|
<link rel="stylesheet" type="text/css" href="{{base_url}}/css/dialog.css" media="all">
|
||||||
<link rel="stylesheet" type="text/css" href="{{base_url}}/css/template.css" media="all">
|
<link rel="stylesheet" type="text/css" href="{{base_url}}/css/template.css" media="all">
|
||||||
|
{{#css}}<link rel="stylesheet" type="text/css" href="{{base_url}}/custom.css" media="all">{{/css}}
|
||||||
|
|
||||||
<!--[if IE 7]>
|
<!--[if IE 7]>
|
||||||
<link rel="stylesheet" type="text/css" href="{{base_url}}/css/ie7.css" media="all">
|
<link rel="stylesheet" type="text/css" href="{{base_url}}/css/ie7.css" media="all">
|
||||||
|
|||||||
@@ -80,6 +80,10 @@ module Precious
|
|||||||
@mathjax
|
@mathjax
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def css # custom css
|
||||||
|
@css
|
||||||
|
end
|
||||||
|
|
||||||
# Access to embedded metadata.
|
# Access to embedded metadata.
|
||||||
#
|
#
|
||||||
# Examples
|
# Examples
|
||||||
|
|||||||
+30
-20
@@ -137,6 +137,10 @@ module Gollum
|
|||||||
# Gets the boolean live preview value.
|
# Gets the boolean live preview value.
|
||||||
attr_reader :live_preview
|
attr_reader :live_preview
|
||||||
|
|
||||||
|
# Injects custom css from custom.css in root repo.
|
||||||
|
# Defaults to false
|
||||||
|
attr_reader :css
|
||||||
|
|
||||||
# Public: Initialize a new Gollum Repo.
|
# Public: Initialize a new Gollum Repo.
|
||||||
#
|
#
|
||||||
# path - The String path to the Git repository that holds the Gollum
|
# path - The String path to the Git repository that holds the Gollum
|
||||||
@@ -166,26 +170,32 @@ module Gollum
|
|||||||
options[:access] = path
|
options[:access] = path
|
||||||
path = path.path
|
path = path.path
|
||||||
end
|
end
|
||||||
@path = path
|
|
||||||
@repo_is_bare = options[:repo_is_bare]
|
# Use .fetch instead of ||
|
||||||
@page_file_dir = options[:page_file_dir]
|
#
|
||||||
@access = options[:access] || GitAccess.new(path, @page_file_dir, @repo_is_bare)
|
# o = { :a => false }
|
||||||
@base_path = options[:base_path] || "/"
|
# o[:a] || true # => true
|
||||||
@page_class = options[:page_class] || self.class.page_class
|
# o.fetch :a, true # => false
|
||||||
@file_class = options[:file_class] || self.class.file_class
|
|
||||||
@markup_classes = options[:markup_classes] || self.class.markup_classes
|
@path = path
|
||||||
@repo = @access.repo
|
@repo_is_bare = options.fetch :repo_is_bare, nil
|
||||||
@ref = options[:ref] || self.class.default_ref
|
@page_file_dir = options.fetch :page_file_dir, nil
|
||||||
@sanitization = options[:sanitization] || self.class.sanitization
|
@access = options.fetch :access, GitAccess.new(path, @page_file_dir, @repo_is_bare)
|
||||||
@ws_subs = options[:ws_subs] ||
|
@base_path = options.fetch :base_path, "/"
|
||||||
self.class.default_ws_subs
|
@page_class = options.fetch :page_class, self.class.page_class
|
||||||
@history_sanitization = options[:history_sanitization] ||
|
@file_class = options.fetch :file_class, self.class.file_class
|
||||||
self.class.history_sanitization
|
@markup_classes = options.fetch :markup_classes, self.class.markup_classes
|
||||||
@live_preview = options[:live_preview] || true
|
@repo = @access.repo
|
||||||
@universal_toc = options[:universal_toc] || false
|
@ref = options.fetch :ref, self.class.default_ref
|
||||||
@mathjax = options[:mathjax] || false
|
@sanitization = options.fetch :sanitization, self.class.sanitization
|
||||||
@show_all = options[:show_all] || false
|
@ws_subs = options.fetch :ws_subs, self.class.default_ws_subs
|
||||||
@collapse_tree = options[:collapse_tree] || false
|
@history_sanitization = options.fetch :history_sanitization, self.class.history_sanitization
|
||||||
|
@live_preview = options.fetch :live_preview, true
|
||||||
|
@universal_toc = options.fetch :universal_toc, false
|
||||||
|
@mathjax = options.fetch :mathjax, false
|
||||||
|
@show_all = options.fetch :show_all, false
|
||||||
|
@collapse_tree = options.fetch :collapse_tree, false
|
||||||
|
@css = options.fetch :css, false
|
||||||
end
|
end
|
||||||
|
|
||||||
# Public: check whether the wiki's git repo exists on the filesystem.
|
# Public: check whether the wiki's git repo exists on the filesystem.
|
||||||
|
|||||||
Reference in New Issue
Block a user