Skip to main content

HTML directory listing

Project description

LinuxDir2HTML

LinuxDir2HTML is a small program to help create an offline manifest of your files in an easily navigable html format. It is a CLI-only clone of Snap2HTML. LinuxDir2HTML is based on DiogenesList, but makes significant improvements to it.

  • Python 3.6+
  • Doesn't fail on symlinks (symlinks are ignored)
  • More graceful invocation and sane usage
  • Much, much, much faster
  • Highly improved code

This program will produce essentially an identical output to Snap2HTML - using the same template from that project.

Installation

Python PIP

Linux

python -m pip install --user linuxdir2html

macOS

python3 -m pip install --user linuxdir2html

Basic

Just download this repository and run the linuxdir2html.py file directly.

Usage

The program takes two mandatory arguments, the directory to be indexed and the output file name without the extension. So:

linuxdir2html ~/Pictures output

will index the contents of /home/Pictures and save the index as output.html in the present working directory.

There are two optional flags. --hidden to include hidden files and directories, and --links to make the HTML link to the files.

Newly introduced in v1.4.0 is a stacking --startswith parameter. For example,

linuxdir2html --startswith 'dev' --startswith 'l' ~ ~/output

will select directories that start with 'd' and the directory named Example from the ~ directory. This processing only affects the root search directory. The result will be saved as output.html in ~. The hidden flag is usable with the startswith flag.

Note LinuxDir2HTML requires Python 3.6 or greater, but if you modify the Python to remove string interpolation and the barely used pathlib, the minimum version will be much lower.

License

The LinuxDir2HTML.py file is licensed under GPLv2.

The template.html file Copyright (C) by Dan and is licensed as GPLv3.

Issues (Wishlist)

Nice. I did everything I set out to do. These are all fixed/improved:

[X] The original Python code was not well-implemented. I've made essentially the minimum efforts needed to improve upon it, but have plans to continue making improvements, but no timeline to do so.

[X] The template HTML is based on an old version, and I'd like to update the output to use the latest available version from Snap2HTML. This will improve the search functionality, among other things.

[X] File links in the HTML are not implemented.

[X] I'd also like to include an option to ignore hidden files.

[X] There are no plans to implement a GUI.

[X] The up-to-date template uses epoch time and converts to your locale. If you'd like to change this behavior, update the JS function timestampToDate in the template.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

linuxdir2html-1.4.0.tar.gz (86.0 kB view details)

Uploaded Source

Built Distribution

linuxdir2html-1.4.0-py3-none-any.whl (85.7 kB view details)

Uploaded Python 3

File details

Details for the file linuxdir2html-1.4.0.tar.gz.

File metadata

  • Download URL: linuxdir2html-1.4.0.tar.gz
  • Upload date:
  • Size: 86.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.3

File hashes

Hashes for linuxdir2html-1.4.0.tar.gz
Algorithm Hash digest
SHA256 8575fe1e1c8b25e35dc89e9acf9a92ea0becec4b953e6fc13d7e0e3c472029f9
MD5 dcc9518e058ac9c6f6c4d9680b8dfc67
BLAKE2b-256 c6584da220e5ebfd13d9276f1481d06f5a2ab75caba869e93d1b7b13d769ad84

See more details on using hashes here.

File details

Details for the file linuxdir2html-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: linuxdir2html-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 85.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.3

File hashes

Hashes for linuxdir2html-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6ac8abef89b1d5953bd5713ae260f75a780c453ff12b54fa41485fdb1b252290
MD5 2a766bf50d95e8a6102bf7c44f416d80
BLAKE2b-256 ad0da916c72512c400ef828b77d89667b516ad5acacd9d6fa23634f22ca3d7d9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page