Skip to content
Snippets Groups Projects
Commit 08a22d01 authored by Mike McQuaid's avatar Mike McQuaid Committed by GitHub
Browse files

Merge pull request #2383 from MikeMcQuaid/docs-manpage

man: generate Markdown man page.
parents c67c426c 650c33e7
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,7 @@ module Homebrew
regenerate_man_pages
if system "git", "-C", HOMEBREW_REPOSITORY, "diff", "--quiet", "docs/brew.1.html", "manpages"
if system "git", "-C", HOMEBREW_REPOSITORY, "diff", "--quiet", "docs/Manpage.md", "manpages"
puts "No changes to manpage output detected."
elsif ARGV.include?("--fail-if-changed")
Homebrew.failed = true
......@@ -38,7 +38,7 @@ module Homebrew
Homebrew.install_gem_setup_path! "ronn"
markup = build_man_page
convert_man_page(markup, TARGET_DOC_PATH/"brew.1.html")
convert_man_page(markup, TARGET_DOC_PATH/"Manpage.md")
convert_man_page(markup, TARGET_MAN_PATH/"brew.1")
cask_markup = (SOURCE_PATH/"brew-cask.1.md").read
......@@ -53,8 +53,7 @@ module Homebrew
.grep(/^#:/)
.map { |line| line.slice(2..-1) }
.join
end
.reject { |s| s.strip.empty? || s.include?("@hide_from_man_page") }
end.reject { |s| s.strip.empty? || s.include?("@hide_from_man_page") }
end
def build_man_page
......@@ -113,7 +112,7 @@ module Homebrew
def target_path_to_format(target)
case target.basename
when /\.html?$/ then ["--fragment", "HTML fragment"]
when /\.md$/ then ["--markdown", "markdown"]
when /\.\d$/ then ["--roff", "man page"]
else
odie "Failed to infer output format from '#{target.basename}'."
......
This diff is collapsed.
# Documentation
## Users
- [`brew` man-page (command documentation)](Manpage.md)
- [Troubleshooting](Troubleshooting.md)
- [Installation](Installation.md)
- [Frequently Asked Questions](FAQ.md)
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment