From 23fb47e455a333d413589828200b01f3fea63802 Mon Sep 17 00:00:00 2001 From: Flynn Duniho Date: Tue, 4 Mar 2025 17:23:38 -0500 Subject: [PATCH 1/3] C, RockyJS, and PKJS docs are all generated properly --- lib/c_docs/doc_member.rb | 7 ++- lib/pebble_documentation_c.rb | 2 + lib/pebble_documentation_js.rb | 2 +- plugins/generator_docs.rb | 4 +- source/_includes/docs/menu.html | 41 +++++++------ source/_layouts/docs.html | 104 +++++++++++++++++--------------- source/docs/c/index.html | 46 +++++++------- 7 files changed, 110 insertions(+), 96 deletions(-) diff --git a/lib/c_docs/doc_member.rb b/lib/c_docs/doc_member.rb index 25bcb55..4175811 100644 --- a/lib/c_docs/doc_member.rb +++ b/lib/c_docs/doc_member.rb @@ -95,7 +95,12 @@ def process_data(node, mapping, platform) def process_typedef(node, mapping, platform) process_return_type(node, mapping, platform) - @data[platform]['argsstring'] = node.at_css('argsstring').content.to_s + argsstring = node.at_css('argsstring') + if argsstring == nil then + @data[platform]['argsstring'] = "" + else + @data[platform]['argsstring'] = argsstring.content.to_s + end process_parameter_list(node, mapping, platform) end diff --git a/lib/pebble_documentation_c.rb b/lib/pebble_documentation_c.rb index b59b5b6..80e6b8e 100644 --- a/lib/pebble_documentation_c.rb +++ b/lib/pebble_documentation_c.rb @@ -55,6 +55,8 @@ def cleanup def download_and_extract(zip, folder) open(zip) do | zf | Zip::File.open(zf.path) do | zipfile | + print("extracted from ", zf.path) + print("\n") zipfile.each do | entry | path = File.join(folder, entry.name).sub('/doxygen_sdk/', '/') FileUtils.mkdir_p(File.dirname(path)) diff --git a/lib/pebble_documentation_js.rb b/lib/pebble_documentation_js.rb index 6223045..924d790 100644 --- a/lib/pebble_documentation_js.rb +++ b/lib/pebble_documentation_js.rb @@ -63,7 +63,7 @@ def process_members(js_module) :properties => member['properties'], :url => url, :kind => kind, - :summary => member['summary'] + :summary => member['memberof'] } add_symbol(symbol) js_module[:children].push(symbol) diff --git a/plugins/generator_docs.rb b/plugins/generator_docs.rb index aa43faa..e611746 100644 --- a/plugins/generator_docs.rb +++ b/plugins/generator_docs.rb @@ -81,8 +81,8 @@ def generate_docs generate_docs_c_preview unless @site.data['docs']['c_preview'].nil? generate_docs_rocky_js generate_docs_pebblekit_js - generate_docs_pebblekit_android - generate_docs_pebblekit_ios + # generate_docs_pebblekit_android + # generate_docs_pebblekit_ios end def render_pages diff --git a/source/_includes/docs/menu.html b/source/_includes/docs/menu.html index 44c5472..0c48eb0 100644 --- a/source/_includes/docs/menu.html +++ b/source/_includes/docs/menu.html @@ -1,45 +1,48 @@ {% comment %} - Copyright 2025 Google LLC +Copyright 2025 Google LLC - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 +http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. {% endcomment %} + {% endcase %} +
{% include search.html %} diff --git a/source/docs/c/index.html b/source/docs/c/index.html index 9935b3e..b47f05c 100644 --- a/source/docs/c/index.html +++ b/source/docs/c/index.html @@ -1,20 +1,18 @@ - - --- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + layout: docs permalink: /docs/c/ title: C SDK Documentation @@ -40,14 +38,14 @@

{{ page.title }}

{% for module in site.data.docs_tree.c %} -
-

{{ module.name }}

- {% if module.summary.size > 0 %} - {{ module.summary }} - {% else %} -

 

- {% endif %} -
+
+

{{ module.name }}

+ {% if module.summary.size > 0 %} + {{ module.summary }} + {% else %} +

 

+ {% endif %} +
{% endfor %}
From b8c48674201cc7970e3ae8d6b07021dfa47df4fd Mon Sep 17 00:00:00 2001 From: Flynn Duniho Date: Tue, 4 Mar 2025 21:49:41 -0500 Subject: [PATCH 2/3] Android docs now work! --- lib/pebble_documentation_pebblekit_android.rb | 5 +++-- plugins/generator_docs.rb | 4 ++-- source/_includes/docs/menu.html | 2 +- source/_layouts/docs.html | 2 +- source/_sass/sections/documentation/android.scss | 1 - 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/pebble_documentation_pebblekit_android.rb b/lib/pebble_documentation_pebblekit_android.rb index 4f7f124..1f4e942 100644 --- a/lib/pebble_documentation_pebblekit_android.rb +++ b/lib/pebble_documentation_pebblekit_android.rb @@ -29,7 +29,7 @@ def initialize(site, source) @path = '/docs/pebblekit-android/' open(source) do | zf | Zip::File.open(zf.path) do | zipfile | - entry = zipfile.glob('javadoc/overview-summary.html').first + entry = zipfile.glob('javadoc/index.html').first summary = Nokogiri::HTML(entry.get_input_stream.read) process_summary(zipfile, summary) @@ -47,7 +47,8 @@ def language def process_summary(zipfile, summary) summary.css('tbody tr').each do | row | - name = row.at_css('td.colFirst').content + print(row) + name = row.at_css('th.colFirst').content package = { name: name, url: "#{@path}#{name_to_url(name)}/", diff --git a/plugins/generator_docs.rb b/plugins/generator_docs.rb index e611746..4d47d46 100644 --- a/plugins/generator_docs.rb +++ b/plugins/generator_docs.rb @@ -77,11 +77,11 @@ def generate_docs # The order of these functions will determine the order of preference # when looking up symbols e.g. double backticks # DO NOT CHANGE THE ORDER UNLESS YOU KNOW WHAT YOU ARE DOING - generate_docs_c + # generate_docs_c generate_docs_c_preview unless @site.data['docs']['c_preview'].nil? generate_docs_rocky_js generate_docs_pebblekit_js - # generate_docs_pebblekit_android + generate_docs_pebblekit_android # generate_docs_pebblekit_ios end diff --git a/source/_includes/docs/menu.html b/source/_includes/docs/menu.html index 0c48eb0..df7ac51 100644 --- a/source/_includes/docs/menu.html +++ b/source/_includes/docs/menu.html @@ -23,10 +23,10 @@ {% else %} {% assign open = false %} {% endif %} - {% if group.children.size > 0 %}
  • {{ group.name }} + {% if group.children.size > 0 %}
      {% for item in group.children %}
    • Documentation {% when 'c_preview' %} {% include docs/menu.html tree=site.data.docs_tree.c_preview group=page.group %} {% when 'rockyjs' %} - {% include docs/menu.html tree=site.data.docs_tree.rockyjs group=page.group %} + {% include docs/menu.html tree=site.data.docs_tree.rockyjs group=page.js_module %} {% when 'pebblekit_js' %} {% include docs/menu.html tree=site.data.docs_tree.pebblekit_js group=page.js_module %} {% when 'pebblekit_ios' %} diff --git a/source/_sass/sections/documentation/android.scss b/source/_sass/sections/documentation/android.scss index 415a90b..be57653 100644 --- a/source/_sass/sections/documentation/android.scss +++ b/source/_sass/sections/documentation/android.scss @@ -346,7 +346,6 @@ display:block; float:left; background-image:url(resources/titlebar.gif); - height:18px; } .overviewSummary .tabEnd, .packageSummary .tabEnd, .contentContainer ul.blockList li.blockList .tabEnd, .summary .tabEnd, .classUseContainer .tabEnd, .constantValuesContainer .tabEnd { width:10px; From b61b462519e6313b9d72667eb23ecae3c266c0c7 Mon Sep 17 00:00:00 2001 From: Flynn Duniho Date: Tue, 4 Mar 2025 21:56:28 -0500 Subject: [PATCH 3/3] Fix brain typo --- .env.sample | 1 + 1 file changed, 1 insertion(+) diff --git a/.env.sample b/.env.sample index 20b9a50..e5cdca7 100644 --- a/.env.sample +++ b/.env.sample @@ -7,6 +7,7 @@ ALGOLIA_API_KEY= ALGOLIA_SEARCH_KEY= ALGOLIA_PREFIX=devsite-dev- GOOGLE_ANALYTICS= +GOOGLE_API= ROLLBAR_CLIENT_TOKEN= RACK_ENV=development SKIP_DOCS=false