super AbstractCompiler
# Destination directory
readable writable var _dir: String = "doc"
-
+ # GitHub Repo name
+ var github_repo: nullable String = null
# Content of a generated file
var _stage_context: StageContext = new StageContext(null)
readable var _opt_custom_title: OptionString = new OptionString("Title displayed in the top of the Overview page and as suffix of all page names", "--custom-title")
readable var _opt_custom_overview_text: OptionString = new OptionString("Text displayed as introduction of Overview page before the modules list", "--custom-overview-text")
readable var _opt_custom_footer_text: OptionString = new OptionString("Text displayed as footer of all pages", "--custom-footer-text")
+ readable var _opt_github_repo_name: OptionString = new OptionString("GitHub repo name, example: --github MyRepoName", "--github")
var sharedir: nullable String
fun public_only: Bool
# generate the index
self.filename = "index.html"
clear
+ addGithubInformation
add("<!DOCTYPE html>")
add("<html><head>{head}<title>Overview | {custom_title}</title></head><body>\n")
add(action_bar)
self.filename = mod.html_name
action_bar = "<header><nav class='main'><ul>{custom_items}<li><a href='./index.html'>Overview</a></li><li class=\"current\">{mod.name}</li><li><a href='full-index.html'>Full Index</a></li><li><a href=\"help.html\">Help</a></li></ul></nav></header>\n"
clear
+ addGithubInformation
add("<!DOCTYPE html>")
add("<html><head>{head}<title>{mod.name} module | {custom_title}</title></head><body>\n")
add(action_bar)
self.filename = c.html_name
action_bar = "<header><nav class='main'><ul>{custom_items}<li><a href='./index.html'>Overview</a></li><li>{c.global.intro.mmmodule.toplevel_owner.html_link(self)}</li><li class=\"current\">{c.name}</li><li><a href='full-index.html'>Full Index</a></li><li><a href=\"help.html\">Help</a></li></ul></nav></header>\n"
clear
+ addGithubInformation
add("<!DOCTYPE html>")
add("<html><head>{head}<title>{c.name} class | {custom_title}</title></head><body>\n")
add(action_bar)
self.filename = "fullindex"
action_bar = "<header><nav class='main'><ul>{custom_items}<li><a href='./index.html'>Overview</a></li><li class=\"current\">Full Index</li><li><a href=\"help.html\">Help</a></li></ul></nav></header>\n"
clear
+ addGithubInformation
add("<!DOCTYPE html>")
add("<html><head>{head}<title>Full Index | {custom_title}</title></head><body>\n")
add(action_bar)
mainmod.file_quicksearch_list_doc(self)
write_to("{dir}/quicksearch-list.js")
end
-
+
+ # Add or not a tag for the github repository
+ fun addGithubInformation do
+ if not github_repo == null then add("<div id=\"repoName\" name=\"{github_repo.to_s}\"></div>")
+ end
# Add a (source) link fo a given location
fun show_source(l: Location)
option_context.add_option(opt_custom_menu_items)
option_context.add_option(opt_custom_overview_text)
option_context.add_option(opt_custom_footer_text)
+ option_context.add_option(opt_github_repo_name)
end
redef fun process_options
end
end
+ var git = opt_github_repo_name.value
+ if not git == null then github_repo = git
end
redef fun handle_property_conflict(lc, impls)