From 6a56330ddec37e510fa1acbd45ad6053d6c967ae Mon Sep 17 00:00:00 2001 From: Andy C Date: Tue, 5 Dec 2023 13:48:13 -0500 Subject: [PATCH] [doctools] Polish ref-check a bit more --- devtools/release.sh | 2 +- doctools/ref_check.py | 27 ++++++++++++++------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/devtools/release.sh b/devtools/release.sh index d21007eaad..09c1e2c77d 100755 --- a/devtools/release.sh +++ b/devtools/release.sh @@ -28,7 +28,7 @@ # # Commit files to oilshell/benchmark-data repo and sync. # benchmarks/report.sh all -# $0 deploy-tar # needed to checksum +# $0 deploy-tar # needed to publish tarball checksum in HTML # build/doc.sh run-for-release # $0 compress # devtools/release-version.sh git-changelog-$VERSION diff --git a/doctools/ref_check.py b/doctools/ref_check.py index f19a3bdab0..304e3ccb05 100755 --- a/doctools/ref_check.py +++ b/doctools/ref_check.py @@ -76,13 +76,11 @@ def Check(all_toc_nodes, chap_tree): log('') - log('Topics in TOC: %d', len(all_topics)) - log('Unique topics in TOC: %d', len(set(all_topics))) - log('Sections not implemented: %d', sections_not_impl) - log('Total topics not implemented: %d', topics_not_impl) - log('') - - log('%d in link_from set: %s', len(link_from), sorted(link_from)[:10]) + log('TOC stats:') + log(' Topics: %d', len(all_topics)) + log(' Unique topics: %d', len(set(all_topics))) + log(' Topic Sections not implemented (X): %d', sections_not_impl) + log(' All topics not implemented: %d', topics_not_impl) log('') if 0: @@ -99,7 +97,7 @@ def Check(all_toc_nodes, chap_tree): chap_topics = collections.defaultdict(list) # topic_id -> list of chapters short_topics = [] - min_words = 10 # arbitrary + min_words = 5 # arbitrary for chap in chap_tree.children: @@ -125,19 +123,22 @@ def Check(all_toc_nodes, chap_tree): elif num_words > 1: short_topics.append((topic_id, topic.text)) - log('%d in link_to set: %s', len(link_to), sorted(link_to)[:10]) - log('') - num_chapters = len(chap_tree.children) - log('Chapter stats') + log('Chapter stats:') log(' num chapters = %d', num_chapters) log(' num_sections = %d', num_sections) log(' num_topics = %d', num_topics) - log(' topics with more than %d words = %d', min_words, num_topics_written) chap_topic_set = set(chap_topics) log(' num unique topics = %d', len(chap_topic_set)) + log(' topics with first draft (more than %d words) = %d', min_words, + num_topics_written) + log('') + + log('%d in link_to set: %s', len(link_to), sorted(link_to)[:10]) + log('') + log('%d in link_from set: %s', len(link_from), sorted(link_from)[:10]) log('') index_topic_set = set(toc_topic_check)