61438453e9f8be7a5949725a688ac6cf709add28 lrnassar Tue Apr 28 13:06:10 2026 -0700 Restructure /docs/ landing page for new users; add docs-page styling. refs #36894 docs/index.md: rewrite as a beginner-first landing page. Replace the prior five-section structure with a flat five-H2 outline -- Tutorials, Visualize your own data, Share your work, Download data, Get help -- so every entry in the sidebar TOC maps to specific content rather than to a vague grouping. Promote the tutorial table from a buried H3 to top-level content. Drop sections that don't serve new users (the "Understanding assemblies/annotations" primer, the MySQL bullet, the mirror paragraph, the Multi-Region View specific mention, and the four scattered "Relevant FAQs" lists). Consolidate help into a single closer with contact, FAQ, workshops, and the suggestion form. Distinguish custom tracks vs track hubs ("simpler option" vs "more powerful and configurable"). Make tutorial titles the table links and drop the redundant Link column. docs/staticPage.lua: add a docs-page class to the row wrapper so /docs/- only CSS can be scoped without affecting other gbsPage static pages. src/hg/htdocs/staticStyle/gbStatic.css: add scoped .docs-page styles for the sidebar TOC ("On this page" label) and tables (roomier padding, zebra striping using the existing tr.even/tr.odd classes, subtle hover). All new rules are namespaced under .docs-page so the rest of the site is untouched. diff --git docs/staticPage.lua docs/staticPage.lua index 615beda2a3d..31aba84f10c 100644 --- docs/staticPage.lua +++ docs/staticPage.lua @@ -1,476 +1,477 @@ -- UCSC: Slightly modified to produce html that follows the genome browser -- static pages conventions -- -- -- This is a sample custom writer for pandoc. It produces output -- that is very similar to that of pandoc's HTML writer. -- There is one new feature: code blocks marked with class 'dot' -- are piped through graphviz and images are included in the HTML -- output using 'data:' URLs. -- -- Invoke with: pandoc -t staticPage.lua -- -- Character escaping local function escape(s, in_attribute) return s:gsub("[<>&\"']", function(x) if x == '<' then return '<' elseif x == '>' then return '>' elseif x == '&' then return '&' elseif x == '"' then return '"' elseif x == "'" then return ''' else return x end end) end -- Helper function to convert an attributes table into -- a string that can be put into HTML tags. local function attributes(attr) local attr_table = {} for x,y in pairs(attr) do if y and y ~= "" then table.insert(attr_table, ' ' .. x .. '="' .. escape(y,true) .. '"') end end return table.concat(attr_table) end -- Run cmd on a temporary file containing inp and return result. local function pipe(cmd, inp) local tmp = os.tmpname() local tmph = io.open(tmp, "w") tmph:write(inp) tmph:close() local outh = io.popen(cmd .. " " .. tmp,"r") local result = outh:read("*all") outh:close() os.remove(tmp) return result end -- Table to store footnotes, so they can be included at the end. local notes = {} -- Table to store headers, so they can be inserted at the end local headers = {} -- flag to see if we have to close a previous div local headerOpen = false -- Blocksep is used to separate block elements. function Blocksep() return "\n\n" end -- Print contents of `tbl`, with indentation. -- `indent` sets the initial level of indentation. function tprint (tbl, indent) if not indent then indent = 0 end for k, v in pairs(tbl) do formatting = string.rep(" ", indent) .. k .. ": " if type(v) == "table" then print(formatting) tprint(v, indent+1) elseif type(v) == 'boolean' then print(formatting .. tostring(v)) else print(formatting .. v) end end end -- remove all special chars from the string and remove all html tags function simplifyId(idStr) idStr=idStr:gsub("%b<>", "") idStr = string.lower(string.gsub(idStr, "%s+", "-")) idStr = string.lower(string.gsub(idStr, "[^a-zA-z-]", "")) return idStr end -- This function is called once for the whole document. Parameters: -- body is a string, metadata is a table, variables is a table. -- This gives you a fragment. You could use the metadata table to -- fill variables in a custom lua template. Or, pass `--template=...` -- to pandoc, and pandoc will add do the template processing as -- usual. function Doc(body, metadata, variables) local buffer = {} local function add(s) table.insert(buffer, s) end -- ucsc changes start -- debugging of meta info: -- print("vars") -- tprint(variables) -- print("meta") -- tprint(metadata) if metadata["title"] then add("") add("") add("") add("") add("") add("") add("") add("/style/bootstrap-3-3-7.min.css\">") add("") add("
" .. escape(s) .. ""
end
function InlineMath(s)
return "\\(" .. escape(s) .. "\\)"
end
function DisplayMath(s)
return "\\[" .. escape(s) .. "\\]"
end
function SingleQuoted(s)
return "‘" .. s .. "’"
end
function DoubleQuoted(s)
return "“" .. s .. "”"
end
function Note(s)
local num = #notes + 1
-- insert the back reference right before the final closing tag.
s = string.gsub(s,
'(.*)', '%1 ↩')
-- add a list item with the note to the note table.
table.insert(notes, '\n" .. s .. "\n
" end -- lev is an integer, the header level. function Header(lev, s, attr) local lines = { } if lev == 1 then idStr = simplifyId(s) table.insert(headers, {text = s, id = idStr}) table.insert(lines, "\n" .. s .. "\n" end function HorizontalRule() return "
" .. escape(s) ..
""
end
end
function BulletList(items)
local buffer = {}
for _, item in pairs(items) do
table.insert(buffer, "' .. caption .. '
\n| ' .. h .. ' | ') empty_header = empty_header and h == "" end if empty_header then head = "" else add('
|---|
| ' .. c .. ' | ') end add('