htmlxword
htmlxword is
A python library that can create a interactive crossword, from an input text file, on a static page using html and javascript.
Demo
See a demo of a created crossword on github. https://trisdav.github.io/htmlxword-pages/
htmlxword usage
- Basic usage:
htmlxword inputfile.txt -o myCrossword.html -t "Crossword Title"
- Example input file:
Noun Person, place, or thing.
adverb A word or phrase that modifies or qualifies an adjective.
adjective A word or phrase describing an attribute.
paragraph A section of a piece of writing.
chapter A section marker in a book.
- Arguments
| short | long | description |
|---|---|---|
| -o | --output | What the output file should be named. |
| -t | --title | Add a title to the crossword page. |
| -y | --config-yaml | Path to a custom yaml config file. |
| -c | --css-template | Path to a custom css file. |
| -j | --javascript | Path to a custom javascript file. |
| -m | --html-tempalte | Path to a custom html template file. |
| -s | --json | input format is json |
| --print-config | Print the contents of the default config.yaml. | |
| --print-css | Print the contents of the default csstemplate.css. | |
| --print-javascript | Print the contents of the default jstemplate.js. | |
| --print-html | Print the contnets of the default html_xword_template.html. |
htmlxword depends on
The python library genxword, which creates crosswords and various formats. This uses genxword to create a layout for the crossword, and then builds a crossword in html and javascript. Genxword has several dependenices, I would refer to that project to determine the dependencies.
JSON input
The crossword clues can also be input as a JSON file. This JSON file supports hints and "with" clues. For example, the answer to the clue "Verb ending with -ing" is "present participle" which is two words. To get around this, clues will be something like "With 2 Across, Verb ending with -ing." To use this input format with the cli use the -s flag.
- json input file
[
{
"word":"Noun",
"clue":"Person, place, or thing.",
"hintTitle":"Hint",
"hint":"English 101"
},
{
"word":"adverb",
"clue":"A word or phrase that modifies or qualifies an adjective."
},
{
"word":"present",
"clue":"Verb ending with -ing",
"with":4
},
{
"word":"participle",
"clue":"Verb ending with -ing",
"with":3
},
{
"word":"adjective",
"clue":"A word or phrase describing an attribute."
},
{
"word":"paragraph",
"clue":"A section of a piece of writing."
},
{
"word":"chapter",
"clue":"A section marker in a book."
}
]
Configurability
The heart of configurability of this project is in html_xword_template.html. Inside that file there are strings like {JS}, {CLUE} which define where to insert generated code segments. Other things can be configred in config.yaml I strongly advise viewing the template files for figuring out how to configure the outputs.
- jstemplate.js, {JS}
- csstemplate.css, {CSS}
config.yaml
- superScript - Defines the html of the superscript in the first block signifying the start of a word.
- letterBlock - Defines html of the crossword blocks that accepts inputs.
- blankBlock - Defines html of the crossword blocks that is an empty cell.
- crossWordRowHtml - Defines html of a crow in the crossword.
- clueHtml - Defines html of the clue text.
- clueListDown - Defines the list which holds the Down clues.
- clueListAcross - Defines the list whcih holds the Across clues.
- clueListItem - Defines an item in the clue list.
Metadata
Release files for htmlxword 0.0.9
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 |
|---|---|---|---|---|
| htmlxword-0.0.9.tar.gz | 24.0 kB | Without provenance | Details for htmlxword-0.0.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| htmlxword-0.0.9-py3-none-any.whl | Python 3 | none | any | Details for htmlxword-0.0.9-py3-none-any.whl |
Total release size: 49.8 kB
Release files / htmlxword-0.0.9.tar.gz
| Download URL | htmlxword-0.0.9.tar.gz |
|---|---|
| Size | 24.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4c1df59f195550680af22337afcde57e87f57af05e93d12833d67661f1935815
|
|
BLAKE2b-256 checksum How to use checksums |
5f898b1d297e5a47eb055f5052ad8d9c82e58cdabfda4f2a4cb39db6a9b0195b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.20
|
Release files / htmlxword-0.0.9-py3-none-any.whl
| Download URL | htmlxword-0.0.9-py3-none-any.whl |
|---|---|
| Size | 25.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a12e67943ed8ff56819151092a2e87fd4f5edb5c26293b9e87fa52e615ae60c5
|
|
BLAKE2b-256 checksum How to use checksums |
63f287e1c272f564b45b6fcbf8d51f5a37f342d0505cd3d3ccaf5b680c3dc852
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.20
|
Security for htmlxword 0.0.9
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.