mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-21 23:58:51 -05:00
utils/generate-module-api-doc.rb: update for redict.io
Signed-off-by: Drew DeVault <sir@cmpwn.com>
This commit is contained in:
parent
5d810f809e
commit
d4622e0592
@ -87,7 +87,7 @@ def docufy(src,i)
|
|||||||
puts "<span id=\"#{name}\"></span>\n\n"
|
puts "<span id=\"#{name}\"></span>\n\n"
|
||||||
puts "### `#{name}`\n\n"
|
puts "### `#{name}`\n\n"
|
||||||
puts " #{proto}\n"
|
puts " #{proto}\n"
|
||||||
puts "**Available since:** #{$since[name] or "unreleased"}\n\n"
|
puts "**Available since:** #{$since[name] or "Redict 7.3.0"}\n\n"
|
||||||
comment = ""
|
comment = ""
|
||||||
while true
|
while true
|
||||||
i = i-1
|
i = i-1
|
||||||
@ -145,18 +145,14 @@ def is_func_line(src, i)
|
|||||||
end
|
end
|
||||||
|
|
||||||
puts "---\n"
|
puts "---\n"
|
||||||
puts "title: \"Modules API reference\"\n"
|
puts "title: \"API reference\"\n"
|
||||||
puts "linkTitle: \"API reference\"\n"
|
|
||||||
puts "weight: 1\n"
|
|
||||||
puts "description: >\n"
|
|
||||||
puts " Reference for the Redict Modules API\n"
|
|
||||||
puts "aliases:\n"
|
|
||||||
puts " - /topics/modules-api-ref\n"
|
|
||||||
puts "---\n"
|
puts "---\n"
|
||||||
puts "\n"
|
puts "\n"
|
||||||
puts "<!-- This file is generated from module.c using\n"
|
puts "<!-- This file is generated from module.c using\n"
|
||||||
puts " utils/generate-module-api-doc.rb -->\n\n"
|
puts " utils/generate-module-api-doc.rb -->\n\n"
|
||||||
src = File.open(File.dirname(__FILE__) ++ "/../src/module.c").to_a
|
puts "# Modules API reference"
|
||||||
|
|
||||||
|
src = File.open("src/module.c").to_a
|
||||||
|
|
||||||
# Build function index
|
# Build function index
|
||||||
$index = {}
|
$index = {}
|
||||||
@ -186,16 +182,6 @@ if File.directory?(git_dir) && `which git` != ""
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Print TOC
|
|
||||||
puts "## Sections\n\n"
|
|
||||||
src.each_with_index do |_line,i|
|
|
||||||
if is_section_doc(src, i)
|
|
||||||
name = get_section_heading(src, i)
|
|
||||||
puts "* [#{name}](\##{section_name_to_id(name)})\n"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
puts "* [Function index](#section-function-index)\n\n"
|
|
||||||
|
|
||||||
# Docufy: Print function prototype and markdown docs
|
# Docufy: Print function prototype and markdown docs
|
||||||
src.each_with_index do |_line,i|
|
src.each_with_index do |_line,i|
|
||||||
if is_func_line(src, i)
|
if is_func_line(src, i)
|
||||||
|
Loading…
Reference in New Issue
Block a user