mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-29 09:47:50 +08:00
JS-3317 Support for directories in webhelp ui
This commit is contained in:
parent
93269caab5
commit
a8fd0d1600
@ -4,6 +4,9 @@
|
|||||||
Also you can use HTML-comments.
|
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)
|
* [Basic Topics](basic_topics.html)
|
||||||
* [Getting Started](getting_started.html)
|
* [Getting Started](getting_started.html)
|
||||||
* [Check Out And Build Community Edition](checkout_and_build_community.html)
|
* [Check Out And Build Community Edition](checkout_and_build_community.html)
|
||||||
|
@ -17,7 +17,6 @@ exclude:
|
|||||||
- '*.scss'
|
- '*.scss'
|
||||||
- README*
|
- README*
|
||||||
- Rakefile
|
- Rakefile
|
||||||
- lib
|
|
||||||
- webhelp-template
|
- webhelp-template
|
||||||
- code_samples
|
- code_samples
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
{% assign product_version = site.product_version %}
|
{% assign product_version = site.product_version %}
|
||||||
{% assign page_title = page.title %}
|
{% assign page_title = page.title %}
|
||||||
{% assign page_title_with_h1 = '' %}
|
{% assign page_title_with_h1 = '' %}
|
||||||
{% assign page_id = page.name | replace:'.md','' %}
|
{% assign page_id = page.url %}
|
||||||
{% assign page_content = content %}
|
{% assign page_content = content %}
|
||||||
{% capture shortcut_switcher %}
|
{% capture shortcut_switcher %}
|
||||||
<div class="shortcuts-switcher"><label for="switch-shortcuts">Keymap:</label><select id="switch-shortcuts" class="select _shortcuts" height="1">
|
<div class="shortcuts-switcher"><label for="switch-shortcuts">Keymap:</label><select id="switch-shortcuts" class="select _shortcuts" height="1">
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
require 'yaml'
|
require 'yaml'
|
||||||
require 'json'
|
require 'json'
|
||||||
|
require 'uri'
|
||||||
require 'kramdown'
|
require 'kramdown'
|
||||||
require 'rexml/document'
|
require 'rexml/document'
|
||||||
require 'rexml/xpath'
|
require 'rexml/xpath'
|
||||||
@ -89,8 +90,11 @@ module Docs
|
|||||||
|
|
||||||
REXML::XPath.each(li_node, 'a') do |link|
|
REXML::XPath.each(li_node, 'a') do |link|
|
||||||
href = link.attribute('href').to_s
|
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://', '//')
|
is_external = href.start_with?('http://', 'https://', 'ftp://', '//')
|
||||||
|
id = href
|
||||||
|
id = '/' + id if !is_absolute_path
|
||||||
item = {
|
item = {
|
||||||
:id => id,
|
:id => id,
|
||||||
:title => link.text(),
|
:title => link.text(),
|
@ -3,7 +3,7 @@ task :build_toc do
|
|||||||
src_dir = CONFIG[:source_dir]
|
src_dir = CONFIG[:source_dir]
|
||||||
toc_file = ENV['dest'] || "#{src_dir}/HelpTOC.json"
|
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']
|
kramdown_config = YAML::load_file("#{src_dir}/_config.yml")['kramdown']
|
||||||
toc = Docs::TocGenerator.extract("#{src_dir}/_SUMMARY.md", kramdown_config)
|
toc = Docs::TocGenerator.extract("#{src_dir}/_SUMMARY.md", kramdown_config)
|
||||||
|
9
another-subfolder/another-sub-subfolder/page.md
Normal file
9
another-subfolder/another-sub-subfolder/page.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
title: Another subfolder test
|
||||||
|
---
|
||||||
|
|
||||||
|
# Another subfolder Test
|
||||||
|
|
||||||
|
subfolders test
|
||||||
|
|
||||||
|
[Link to page in other folder](../page.html)
|
7
another-subfolder/page.md
Normal file
7
another-subfolder/page.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
title: Another folder test
|
||||||
|
---
|
||||||
|
|
||||||
|
# Another folder Test
|
||||||
|
|
||||||
|
Test
|
8
subfolder/sub-subfolder/page.md
Normal file
8
subfolder/sub-subfolder/page.md
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
title: Subfolder test
|
||||||
|
---
|
||||||
|
|
||||||
|
# Test
|
||||||
|
|
||||||
|
subfolders test
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user