ez-txt2html
ezTxt2Html is a simple open-source Python program that converts plain text and markdown files (.txt, .md) into HTML files (.html). You can use it to convert individual file or all files in a directory.
Installation
To use ez-txt2html, follow these steps:
- Ensure you have the latest version of Python 3 installed.
python --version
-
If needed, download and install Python 3
-
Clone or download this repository to your local machine:
git clone https://github.com/bryce-seefieldt/ez-txt2html.git
- Change your current working directory to the src directory within the project folder:
cd ez-txt2html\src
Now, you have successfully installed ez-txt2html.
Usage
You can run ez-txt2html from the command line. It accepts the following command-line arguments:
- '-h' or '--help': Display help screen.
- '-v' or '--version': Display the current version of ez-txt2html and exit.
- 'inputPath' (required): Provide the path to the target file or directory containing the files to be converted.
- '-o' or '--output' (optional): Define the output directory for the HTML files. If not specified, it defaults to ./HTML.
- '-c' or '--config' (optional): Provide a custom TOML config file with pre-defined arguments.
Here's how you can run ez_txt2html:
python ez-txt2html.py inputPath [-o outputPath] [-c configPath]
- 'inputPath': Replace this with the path to the target file or directory containing text or markdown files.
- 'o outputPath' (optional): Replace this with the desired output directory for the HTML files.
- 'c configPath' (optional): Replace this with the path to a .toml config file.
Input
- Convert a single text or markdown file to HTML:
python ez_txt2html.py path/to/yourfile.txt
- Convert all text or markdown files in a directory to HTML:
python ez_txt2html.py path/to/yourdirectory
Output
HTML files will be saved to automatically created ./src/HTML/ directory as a default. Use '-o' or '--output' along with your desirec directory path in order to overide the default save location. This output folder will be overwritten entirely with each execution of the program. HTML files will have the same name as the input files but with the .html extension.
Configuration File
Arguments may be pre-defined in a TOML file and passed to the program.
Example TOML configuration (i.e. in a file named config.toml):
output = "./HTML"
Note: Using a config file will override other command line switches (if provided).
Examples
The included examples folder contains a sample text file which can be run to get an idea of this tool works. While in the src folder run:
python ez_txt2html.py ../examples/ to see how it convert all text files in a folder, OR
python ez_txt2html.py ../examples/til.md to see how it converts a single specified file.
The converted HTML files will appear in /src/HTML/ unless otherwise specified.
To specify the output directory add '-o' or '--output' forllowed by the local or relative destination path to the command line:
python ez-txt2html.py ../examples/til.md -o ../examples
To utilize a config file add '-c' or '--output' followed by the path to the .toml file: python ez_txt2html.py ../examples/ -c ../config.toml
Version
The current version of ez-txt2html is 1.0.2
License
This program is open-source and released under the MIT License. Feel free to use and modify it as needed.
Author
ez-txt2html is maintained by Bryce Seefieldt.
If you encounter any issues or have suggestions for improvements, please open an issue.
Enjoy converting your text files to HTML with ez-txt2html!
Metadata
Release files for ez-txt2html-bryce-seefieldt 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ez_txt2html_bryce_seefieldt-1.0.2.tar.gz | 12.2 kB | Without provenance | Details for ez_txt2html_bryce_seefieldt-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ez_txt2html_bryce_seefieldt-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for ez_txt2html_bryce_seefieldt-1.0.2-py3-none-any.whl |
Total release size: 19.5 kB
Release files / ez_txt2html_bryce_seefieldt-1.0.2.tar.gz
| Download URL | ez_txt2html_bryce_seefieldt-1.0.2.tar.gz |
|---|---|
| Size | 12.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b2067593745cd51eebad2e01cb6cb9f0c6548e521343f59811fbf61c7abad04d
|
|
BLAKE2b-256 checksum How to use checksums |
4208eea1b1b47cd38e44ef2f3aec03205d09763c134cf5befcd26bc073816ea5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.0
|
Release files / ez_txt2html_bryce_seefieldt-1.0.2-py3-none-any.whl
| Download URL | ez_txt2html_bryce_seefieldt-1.0.2-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f28cc325acfe851b6e95b4e55921cc1433d0e75e1bb0d13b206611cd6d2e682a
|
|
BLAKE2b-256 checksum How to use checksums |
58fa045cab32d2ed78d4d853e09936643582bb460383d5b281544fa91461be48
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.0
|
Security for ez-txt2html-bryce-seefieldt 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.