This repository has been archived by the owner on Nov 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
230 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
module Converter | ||
# Define the Kramdown method to convert markdown to HTML. | ||
def kramdown( text ) | ||
Kramdown::Document.new( text ).to_html | ||
end | ||
|
||
# Read content in the given path | ||
def content(path) | ||
File.read(path) | ||
end | ||
|
||
# The CSS to append to the HTML report with broken links | ||
def css | ||
<<-CSS.gsub(/[[:blank:]]+/, " ") | ||
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet"> | ||
<style> | ||
/* Lists | ||
–––––––––––––––––––––––––––––––––––––––––––––––––– */ | ||
ul { | ||
list-style: disc; | ||
font-family: \'Roboto\', sans-serif; | ||
color: red; } | ||
ol { | ||
list-style: decimal inside; }css | ||
ol, ul { | ||
padding-left: 0; | ||
margin-top: 0; } | ||
ul ul, | ||
ul ol, | ||
ol ol, | ||
ol ul { | ||
margin: 1.5rem 0 1.5rem 3rem; | ||
font-size: 90%; | ||
color: black;} | ||
li { | ||
margin-bottom: 1rem; | ||
font-weight: bold;} | ||
</style> | ||
CSS | ||
end | ||
|
||
# Automatically open the HTML report in a browser. | ||
def open_in_browser(path) | ||
Launchy.open( path ) do |exception| | ||
puts "Attempted to open #{path} and failed because #{exception}".red | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module Jekyll | ||
## Run Jekyll | ||
def jekyll(options) | ||
sh "bundle exec jekyll #{options}" | ||
end | ||
|
||
## Jekyll preview | ||
def preview(options = '') | ||
jekyll('serve -I -o ' + options) | ||
end | ||
|
||
## Include local config to preview | ||
def preview_local | ||
preview('--config _config.yml,_config.local.yml') | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace :preview do | ||
desc 'Preview the entire devdocs locally' | ||
task all: %w[install cleanup] do | ||
puts "Generating the entire devdocs locally ... ".magenta | ||
preview | ||
end | ||
end |
Oops, something went wrong.