Skip to content

Commit

Permalink
[rename] Remove "oil" in a few places
Browse files Browse the repository at this point in the history
[doc/ref] Fix TOC title and intro
  • Loading branch information
Andy C committed Mar 11, 2024
1 parent 1a2934d commit b2424c8
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 36 deletions.
6 changes: 3 additions & 3 deletions benchmarks/compute.sh
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,8 @@ soil-run() {
mkdir -p $BASE_DIR

# Test the one that's IN TREE, NOT in ../benchmark-data
local -a oil_bin=( $OSH_CPP_NINJA_BUILD _bin/cxx-opt+bumpleak/osh)
ninja "${oil_bin[@]}"
local -a osh_bin=( $OSH_CPP_NINJA_BUILD _bin/cxx-opt+bumpleak/osh)
ninja "${osh_bin[@]}"

local single_machine='no-host'

Expand All @@ -426,7 +426,7 @@ soil-run() {

benchmarks/id.sh shell-provenance-2 \
$single_machine $job_id _tmp \
bash dash python2 "${oil_bin[@]}"
bash dash python2 "${osh_bin[@]}"

local provenance=_tmp/provenance.txt
local host_job_id="$single_machine.$job_id"
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/osh-parser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,8 @@ soil-run() {
rm -r -f $BASE_DIR
mkdir -p $BASE_DIR

local -a oil_bin=( $OSH_CPP_NINJA_BUILD )
ninja "${oil_bin[@]}"
local -a osh_bin=( $OSH_CPP_NINJA_BUILD )
ninja "${osh_bin[@]}"

local single_machine='no-host'

Expand All @@ -491,7 +491,7 @@ soil-run() {

benchmarks/id.sh shell-provenance-2 \
$single_machine $job_id _tmp \
bash dash bin/osh "${oil_bin[@]}"
bash dash bin/osh "${osh_bin[@]}"

# TODO: measure* should use print-tasks | run-tasks
local provenance=_tmp/provenance.txt
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/osh-runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ soil-run() {
extract

# could add _bin/cxx-bumpleak/oils-for-unix, although sometimes it's slower
local -a oil_bin=( $OSH_CPP_NINJA_BUILD )
ninja "${oil_bin[@]}"
local -a osh_bin=( $OSH_CPP_NINJA_BUILD )
ninja "${osh_bin[@]}"

local single_machine='no-host'

Expand All @@ -353,7 +353,7 @@ soil-run() {
# Write _tmp/provenance.* and _tmp/{host,shell}-id
shell-provenance-2 \
$single_machine $job_id _tmp \
bash dash bin/osh "${oil_bin[@]}"
bash dash bin/osh "${osh_bin[@]}"

local host_job_id="$single_machine.$job_id"
local raw_out_dir="$BASE_DIR/raw.$host_job_id"
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/vm-baseline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ soil-run() {
rm -r -f $BASE_DIR
mkdir -p $BASE_DIR

local -a oil_bin=( $OSH_CPP_NINJA_BUILD )
ninja "${oil_bin[@]}"
local -a osh_bin=( $OSH_CPP_NINJA_BUILD )
ninja "${osh_bin[@]}"

local single_machine='no-host'

Expand All @@ -158,7 +158,7 @@ soil-run() {

benchmarks/id.sh shell-provenance-2 \
$single_machine $job_id _tmp \
bash dash bin/osh "${oil_bin[@]}"
bash dash bin/osh "${osh_bin[@]}"

# TODO: measure* should use print-tasks | run-tasks
local provenance=_tmp/provenance.txt
Expand Down
6 changes: 4 additions & 2 deletions doc/ref/toc-osh.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ preserve_anchor_case: yes
---

OSH Table of Contents
===============
=====================

These are links to topics in the [Oils Reference](index.html).
[OSH]($xref) is a POSIX- and [bash]($xref)-compatible shell.

This page has links to topics in the [Oils Reference](index.html).

Siblings: [YSH Topics](toc-ysh.html), [Data Topics](toc-data.html)

Expand Down
9 changes: 6 additions & 3 deletions doc/ref/toc-ysh.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ css_files: ../../web/base.css ../../web/ref-index.css ../../web/toc.css
preserve_anchor_case: yes
---

OSH Table of Contents
===
YSH Table of Contents
=====================

These are links to topics in the [Oils Reference](index.html).
[YSH]($xref) is shell with familiar syntax, JSON-like data structures, and
more. It handles errors properly.

This page has links to topics in the [Oils Reference](index.html).

Siblings: [OSH Topics](toc-osh.html), [Data Topics](toc-data.html)

Expand Down
12 changes: 6 additions & 6 deletions doctools/cmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from doctools import html_lib
from doctools import doc_html # templates
from doctools import oil_doc
from doctools import oils_doc

# Geez find_library returns the filename and not the path? Just hardcode it as
# a workaround.
Expand Down Expand Up @@ -261,28 +261,28 @@ def Render(opts, meta, in_file, out_file, use_fastlex=True, debug_out=None):
# First convert to HTML
html = md2html(in_file.read())

# Now process HTML with oil_doc
# Now process HTML with oils_doc
if use_fastlex:
# Note: extract code BEFORE doing the HTML highlighting.
if opts.code_block_output:
with open(opts.code_block_output, 'w') as f:
f.write('# %s: code blocks extracted from Markdown/HTML\n\n' %
opts.code_block_output)
text = oil_doc.ExtractCode(html, f)
text = oils_doc.ExtractCode(html, f)

html = oil_doc.RemoveComments(html)
html = oils_doc.RemoveComments(html)

# Hack for allowing tables without <p> in cells, which CommonMark seems to
# require?
html = html.replace('<p><pstrip>', '')
html = html.replace('</pstrip></p>', '')

# Expand $xref, etc.
html = oil_doc.ExpandLinks(html)
html = oils_doc.ExpandLinks(html)

# <code> blocks
# Including class=language-oil-help-topics
html = oil_doc.HighlightCode(html, meta.get('default_highlighter'),
html = oils_doc.HighlightCode(html, meta.get('default_highlighter'),
debug_out=debug_out)

# h2 is the title. h1 is unused.
Expand Down
2 changes: 1 addition & 1 deletion doctools/cmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ readonly URL="https://github.com/commonmark/cmark/archive/$CMARK_VERSION.tar.gz"
# https://pypi.org/project/Pygments/#history
#
# 7/2023: Download the wheel file
# doctools/oil_doc.py OPTIONALLY uses this
# doctools/oils_doc.py OPTIONALLY uses this
#
# It's only used in the blog, so let's just put it in the oilshell.org repo,
# not the oil repo
Expand Down
4 changes: 2 additions & 2 deletions doctools/help_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ def TopicMetadata():

elif action == 'ref-check':
from doctools import cmark
from doctools import oil_doc
from doctools import oils_doc
from doctools import ref_check

chapters = []
Expand All @@ -606,7 +606,7 @@ def TopicMetadata():
# language-chapter-links-*

box_nodes = []
html = oil_doc.HighlightCode(html, None,
html = oils_doc.HighlightCode(html, None,
debug_out=box_nodes)
all_toc_nodes.append({'toc': filename, 'boxes': box_nodes})

Expand Down
2 changes: 1 addition & 1 deletion doctools/oil_doc.py → doctools/oils_doc.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python2
"""
oil_doc.py: HTML processing for Oil documentation.
oils_doc.py: HTML processing for Oil documentation.
Plugins:
ExpandLinks expands $xref, etc.
Expand Down
14 changes: 7 additions & 7 deletions doctools/oil_doc_test.py → doctools/oils_doc_test.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env python2
"""
oil_doc_test.py: Tests for oil_doc.py
oils_doc_test.py: Tests for oils_doc.py
"""
from __future__ import print_function

import sys
import unittest

from doctools import oil_doc # module under test
from doctools import oils_doc # module under test
from lazylex import html

with open('lazylex/testdata.html') as f:
Expand All @@ -25,11 +25,11 @@ def testExpandLinks(self):
NOTE: THIs could really be done with a ref like <a.*href="(.*)">
But we're testing it
"""
h = oil_doc.ExpandLinks(TEST_HTML)
h = oils_doc.ExpandLinks(TEST_HTML)
self.assert_('/blog/tags.html' in h, h)

def testShPrompt(self):
r = oil_doc._PROMPT_LINE_RE
r = oils_doc._PROMPT_LINE_RE
line = 'oil$ ls -l&lt;TAB&gt; # comment'
m = r.match(line)

Expand All @@ -38,14 +38,14 @@ def testShPrompt(self):
print(m.group(2))
print(m.end(2))

plugin = oil_doc.ShPromptPlugin(line, 0, len(line))
plugin = oils_doc.ShPromptPlugin(line, 0, len(line))
out = html.Output(line, sys.stdout)
plugin.PrintHighlighted(out)

def testHighlightCode(self):
# lazylex/testdata.html has the language-sh-prompt

h = oil_doc.HighlightCode(TEST_HTML, None)
h = oils_doc.HighlightCode(TEST_HTML, None)
self.assert_('<span class="sh-prompt">' in h, h)
#print(h)

Expand All @@ -59,7 +59,7 @@ def testPygmentsPlugin(self):
echo hi &gt; out.txt
</code></pre>
'''
h = oil_doc.HighlightCode(HTML, None)
h = oils_doc.HighlightCode(HTML, None)

# assert there's no double escaping
self.assert_('hi &gt; out.txt' in h, h)
Expand Down
2 changes: 1 addition & 1 deletion lazylex/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def ToText(s, left_pos=0, right_pos=0):
Given HTML, return text by unquoting &gt; and &lt; etc.
Used by:
doctools/oil_doc.py: PygmentsPlugin
doctools/oils_doc.py: PygmentsPlugin
doctool/make_help.py: HelpIndexCards
In the latter case, we cold process some tags, like:
Expand Down
2 changes: 1 addition & 1 deletion test/shell-vs-shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cmark() {
}

highlight-code() {
PYTHONPATH=. doctools/oil_doc.py highlight "$@"
PYTHONPATH=. doctools/oils_doc.py highlight "$@"
}

desc() {
Expand Down

0 comments on commit b2424c8

Please sign in to comment.