Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update table of contents of docs #811

Closed
wants to merge 1 commit into from

Conversation

wezm
Copy link

@wezm wezm commented Apr 8, 2020

This PR updates the table of contents of the docs to link to all current modules. I also fixed a few broken links/anchors.

I think this closes: #650, and #810

In case it's useful to anyone this is the script (generate-toc) I used to generate it:

#!/usr/bin/env ruby

require 'pathname'

MODULES = {
  'API' => 'Revery_Core',
  'Components' => 'Revery_UI_Components',
  'Draw' => 'Revery_Draw',
  'Fonts' => 'Revery_Font',
  'Hooks' => 'Revery_UI_Hooks__',
  'Math' => 'Revery_Math',
  'Native' => 'Revery_Native',
  'UI' => 'Revery_UI',
  'Utility' => 'Revery_Utility',
}
base_path = ARGV.shift

if base_path.nil?
  warn 'Usage generate-nav _esy/doc/store/b/revery-xxxxxxxx/default/_doc/_html/Revery'
  exit 2
end

base_path = Pathname(base_path)

SubModule = Struct.new(:name, :href)

MODULES.each do |mod, path|
  mod_path = base_path + path

  puts "  {li #{mod}}"
  puts "  {li\n    {ul"

  sub_modules = []
  mod_path.each_child(false) do |child|
    candidate = base_path + path + child + 'index.html'
    if candidate.file?
      href = Pathname('../Revery') + path + child + 'index.html'
      name = mod == 'Hooks' ? child.to_s.downcase : child.to_s
      sub_modules << SubModule.new(name, href)
    end
  end

  # sort
  sub_modules.sort_by!(&:name)

  sub_modules.each do |mod|
    puts "                {li {{:#{mod.href}} #{mod.name}}}"
  end

  puts "            }"
  puts "    }"
end

@Et7f3
Copy link
Member

Et7f3 commented Apr 8, 2020

No #444 is not fully implemented. We lack windows and js target.

@Et7f3
Copy link
Member

Et7f3 commented Apr 8, 2020

Can you commit this file ? We use GHA Ci to deploys docs.

@wezm
Copy link
Author

wezm commented Apr 8, 2020

Can you commit this file ? We use GHA Ci to deploys docs.

Which file is that?

@Et7f3
Copy link
Member

Et7f3 commented Apr 10, 2020

In this branch were I have tried to update the doc. 6d3aadb#diff-a7f89ba2c8e933f7229ed26bc2835174L65-R71
We can see {li {{:../Revery/Revery_UI_Hooks/index.html} effect}} instead of {li {{:../Revery/Revery_UI_Hooks__/Effect/index.html} effect}}. Maybe you could adapt your script. odoc generate some id so we can use like that: {li {{:../Revery/Revery_UI_Hooks/index.html#val-effect} effect}}

Also to obtain this path: _esy/doc/store/b/revery-xxxxxxxx/default/_doc/_html/Revery you could exec: esy @doc print

And can you commit generate-toc.rb so we can call it inside the build doc task

@wezm wezm closed this Aug 11, 2020
@chinwobble
Copy link
Contributor

@wezm it would be good if something like this got merged. I clicked on some of the links in the table of contents and they are broken.

I would be willing to help out on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect link to hooks document
3 participants