Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ When querying explainshell, it:

## Missing man pages

Right now explainshell.com contains the entire [archive of Ubuntu](http://manpages.ubuntu.com/). It's not
Right now explainshell.com contains the entire [archive of Ubuntu](https://manpages.ubuntu.com/). It's not
possible to directly add a missing man page to the live site (it might be in the future).

## Running explainshell locally
Expand Down
2 changes: 1 addition & 1 deletion explainshell/manpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def _parsetext(lines):
section = None
i = 0
for l in lines:
l = re.sub(_href, r'<a href="http://manpages.ubuntu.com/manpages/precise/en/man\2/\1.\2.html">', l)
l = re.sub(_href, r'<a href="https://manpages.ubuntu.com/manpages/jammy/en/man\2/\1.\2.html">', l)
for lookfor, replacewith in _replacements:
l = re.sub(lookfor, replacewith, l)
# confirm the line is valid utf8
Expand Down
2 changes: 1 addition & 1 deletion explainshell/web/templates/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div id="about">
<p>Hello,</p>
<p>This site contains 29761 parsed manpages from sections 1 and 8 found in
<a href="http://manpages.ubuntu.com/">Ubuntu's manpage repository</a>.
<a href="https://manpages.ubuntu.com/">Ubuntu's manpage repository</a>.
A lot of heuristics were used to extract the arguments of each
program, and there are errors here and there, especially in
manpages that have a non-standard layout.</p>
Expand Down
2 changes: 1 addition & 1 deletion explainshell/web/templates/explain.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<div class="push"></div><div class="text-center"><small>
{% for m in matches if m.name %}
{% if loop.first %}source manpages: {% endif %}
<a href="http://manpages.ubuntu.com/manpages/precise/en/man{{ m.section }}/{{ m.source|e }}.html">{{ m.name|e }}</a>{% if not loop.last %},&nbsp;{% endif %}
<a href="https://manpages.ubuntu.com/manpages/jammy/en/man{{ m.section }}/{{ m.source|e }}.html">{{ m.name|e }}</a>{% if not loop.last %},&nbsp;{% endif %}
{% endfor %}
</small></div>
{%- endblock %}
Expand Down
4 changes: 2 additions & 2 deletions explainshell/web/templates/macros.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{% macro outputcommand(mp, suggestions) -%}
{% if suggestions|length == 0 %}
<a href="http://manpages.ubuntu.com/manpages/precise/en/man{{ mp.section }}/{{ mp.source }}.html">{{ mp.program|e }}</a>
<a href="https://manpages.ubuntu.com/manpages/jammy/en/man{{ mp.section }}/{{ mp.source }}.html">{{ mp.program|e }}</a>
{% else %}
<span class="dropdown">
<b class="caret" data-toggle="dropdown"></b>
<a href="http://manpages.ubuntu.com/manpages/precise/en/man{{ mp.section }}/{{ mp.source }}.html">{{ mp.program|e }}</a>
<a href="https://manpages.ubuntu.com/manpages/jammy/en/man{{ mp.section }}/{{ mp.source }}.html">{{ mp.program|e }}</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu">
<li>other manpages</li>
<li class="divider"></li>
Expand Down
2 changes: 1 addition & 1 deletion explainshell/web/templates/tagger.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="small-push"></div>
<div class="push"></div>
<div id="command">
<a href="http://manpages.ubuntu.com/manpages/precise/en/man1/{{ m.name }}.html">{{ m.name|e }}</a> - {{ m.synopsis|e }}
<a href="https://manpages.ubuntu.com/manpages/jammy/en/man1/{{ m.name }}.html">{{ m.name|e }}</a> - {{ m.synopsis|e }}
</div>
<div class="small-push"></div>
<div style="width: 1000px;">
Expand Down
6 changes: 3 additions & 3 deletions tools/extractgzlist
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash

release="precise"
release="jammy"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can confirm these changes are necessary to even download.
precise manpages e.g. https://manpages.ubuntu.com/manpages/precise/en/man8 no longer available, they all return 404.

And any http: now redirects to https: (could work with curl --location but startign from https: is of course more secure).

The other changes are just for rendered links to be correct 👍

Specifically, the steps to download:

  1. tools/extractgzlist
  2. Edit tools/extractgzlist to section="1" and run it again.
  3. Edit tools/dlgzlist to end with done < gzlist8 and run it (took ~4hours)
  4. Edit tools/dlgzlist to end with done < gzlist1 and run it. Will take over a day, I reduced the sleep range to (500, 1000) and it still worked, took ~16hours.

section="8"
man1list="http://manpages.ubuntu.com/manpages/$release/en/man$section/"
gzroot="http://manpages.ubuntu.com/manpages.gz/$release/man$section/"
man1list="https://manpages.ubuntu.com/manpages/$release/en/man$section/"
gzroot="https://manpages.ubuntu.com/manpages.gz/$release/man$section/"
filename="index$section.html"

if ! [ -f $filename ]; then
Expand Down