diff --git a/docs/file-scrapers.md b/docs/file-scrapers.md index 164b6f7d..923bac20 100644 --- a/docs/file-scrapers.md +++ b/docs/file-scrapers.md @@ -298,7 +298,9 @@ Make sure to set the version per the release tag (e.g. r160). Note that the r pr curl https://codeload.github.com/mrdoob/three.js/tar.gz/refs/tags/r${VERSION} > threejs.tar.gz tar -xzf threejs.tar.gz mkdir -p docs/threejs~${VERSION} +mv three.js-r${VERSION}/list.json /tmp/list.json mv three.js-r${VERSION}/docs/* docs/threejs~${VERSION}/ + rm -rf three.js-r${VERSION}/ rm threejs.tar.gz ``` diff --git a/lib/docs/filters/threejs/clean_html.rb b/lib/docs/filters/threejs/clean_html.rb index ac1cb036..abee6997 100644 --- a/lib/docs/filters/threejs/clean_html.rb +++ b/lib/docs/filters/threejs/clean_html.rb @@ -4,6 +4,7 @@ module Docs def call # Remove unnecessary elements css('head, script, style').remove + # Wrap code blocks with pre tags and add syntax highlighting css('code').each do |node| unless node.parent.name == 'pre' diff --git a/lib/docs/scrapers/threejs.rb b/lib/docs/scrapers/threejs.rb index bc792fae..e596e034 100644 --- a/lib/docs/scrapers/threejs.rb +++ b/lib/docs/scrapers/threejs.rb @@ -40,8 +40,6 @@ module Docs Licensed under the MIT License. HTML - self.class_attribute :release - version '171' do self.release = '171' self.base_url = "https://threejs.org/docs" @@ -53,7 +51,7 @@ module Docs def initial_paths paths = [] - json_path = File.expand_path("docs/threejs~#{self.release}/list.json") + json_path = File.expand_path("/tmp/list.json") json_content = File.read(json_path) json_data = JSON.parse(json_content)