JS-3317 Support for directories in webhelp ui

This commit is contained in:
kisenka 2015-04-16 21:20:47 +04:00
parent 93269caab5
commit a8fd0d1600
9 changed files with 34 additions and 4 deletions

View File

@ -4,6 +4,9 @@
Also you can use HTML-comments.
-->
* [Test page from subfolder](subfolder/sub-subfolder/page.html)
* [Test subpage from subfolder](another-subfolder/page.html)
* [Test another page from subfolder](another-subfolder/another-sub-subfolder/page.html)
* [Basic Topics](basic_topics.html)
* [Getting Started](getting_started.html)
* [Check Out And Build Community Edition](checkout_and_build_community.html)

View File

@ -17,7 +17,6 @@ exclude:
- '*.scss'
- README*
- Rakefile
- lib
- webhelp-template
- code_samples

View File

@ -3,7 +3,7 @@
{% assign product_version = site.product_version %}
{% assign page_title = page.title %}
{% assign page_title_with_h1 = '' %}
{% assign page_id = page.name | replace:'.md','' %}
{% assign page_id = page.url %}
{% assign page_content = content %}
{% capture shortcut_switcher %}
<div class="shortcuts-switcher"><label for="switch-shortcuts">Keymap:</label><select id="switch-shortcuts" class="select _shortcuts" height="1">

View File

@ -1,5 +1,6 @@
require 'yaml'
require 'json'
require 'uri'
require 'kramdown'
require 'rexml/document'
require 'rexml/xpath'
@ -89,8 +90,11 @@ module Docs
REXML::XPath.each(li_node, 'a') do |link|
href = link.attribute('href').to_s
id = File.basename(href, File.extname(href))
uri = URI.parse(href)
is_absolute_path = href.start_with?('/')
is_external = href.start_with?('http://', 'https://', 'ftp://', '//')
id = href
id = '/' + id if !is_absolute_path
item = {
:id => id,
:title => link.text(),

View File

@ -3,7 +3,7 @@ task :build_toc do
src_dir = CONFIG[:source_dir]
toc_file = ENV['dest'] || "#{src_dir}/HelpTOC.json"
load "#{src_dir}/lib/toc_generator.rb"
load "#{src_dir}/_lib/toc_generator.rb"
kramdown_config = YAML::load_file("#{src_dir}/_config.yml")['kramdown']
toc = Docs::TocGenerator.extract("#{src_dir}/_SUMMARY.md", kramdown_config)

View File

@ -0,0 +1,9 @@
---
title: Another subfolder test
---
# Another subfolder Test
subfolders test
[Link to page in other folder](../page.html)

View File

@ -0,0 +1,7 @@
---
title: Another folder test
---
# Another folder Test
Test

View File

@ -0,0 +1,8 @@
---
title: Subfolder test
---
# Test
subfolders test