Skip to content

Commit

Permalink
Nbconvert dynamic theme
Browse files Browse the repository at this point in the history
* Nbconvert (#24)

* Minor edits

* timeline report benchmarked - 2023-12-06T22:26:47.277343+00:00

* Timeline update - 2023-12-06T22:22:50.632534+00:00

* index and readme timestamp update - 2023-12-06T22:27:03.644268+00:00

* rush report benchmarked - 2023-12-08T20:51:23.018700+00:00

* Docstrings and black formatting

* black formatting

* Minor bug fix

* bug fix attempt

* correct bug fix

* More documentation bug fix

* bandai report benchmarked - 2023-12-11T05:02:26.605007+00:00

* Bandai update - 2023-12-11T05:02:15.417164+00:00

* cards report benchmarked - 2023-12-11T05:05:43.595833+00:00

* Cards update - 2023-12-11T05:02:54.334269+00:00

* rush report benchmarked - 2023-12-11T05:06:41.222194+00:00

* Rush duel update - 2023-12-11T05:05:56.436722+00:00

* sets report benchmarked - 2023-12-11T05:18:11.845038+00:00

* Sets update - 2023-12-11T05:06:51.869986+00:00

* speed report benchmarked - 2023-12-11T18:50:23.431179+00:00

* Speed update - 2023-12-11T18:49:55.928175+00:00

* index and readme timestamp update - 2023-12-11T18:50:34.013884+00:00

* emergency bug fix

* 12122023

* nbconvert template and restructuring assets

* Update install.sh

Better install script

Signed-off-by: Guilherme Ruiz <57478888+guigoruiz1@users.noreply.github.com>

* better handling of requirements

* changed nbconvert template name to labdynamic

* changed default data file name from "all_report" to "report_data" - needs testing

* better readme and directory structure

* Excluding toc from section numbering

* Jekyll update

* better install script

---------

Signed-off-by: Guilherme Ruiz <57478888+guigoruiz1@users.noreply.github.com>

* Jekyll updates

---------

Signed-off-by: Guilherme Ruiz <57478888+guigoruiz1@users.noreply.github.com>
  • Loading branch information
guigoruiz1 authored Dec 24, 2023
1 parent 7269f3d commit d972169
Show file tree
Hide file tree
Showing 25 changed files with 4,454 additions and 49 deletions.
10 changes: 8 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@ remote_theme: jekyll/minima
minima:
skin: auto
social_links:
- { platform: github, user_url: "https://github.com/guigoruiz1/yugiquery" }

- { platform: github, user_url: "https://github.com/guigoruiz1" }
- { platform: linkedin, user_url: "https://www.linkedin.com/in/guigoruiz1" }
- { platform: stackoverflow, user_url: "https://stackoverflow.com/users/6794856" }

header_pages:
# - README.md
- LICENSE.md

plugins:
- jekyll-feed
- jekyll-seo-tag
Expand Down
2 changes: 1 addition & 1 deletion assets/gateway.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>Gateway Connector</title>
</head>
<body>
<h1>Use this to connect to the gateway.</h1>
<h1>Use this to connect to the Discord gateway.</h1>
<p>
Once you put in your token, and click connect, it will connect, and then let you know when you can close the
browser. After that, you should be good to go.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
76 changes: 54 additions & 22 deletions assets/README.md → assets/markdown/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,62 +44,94 @@ The full YugiQuery workflow can be run with
python yugiquery.py
```

Any Jupyter notebook in the *source* directory will be assumed to be a report and will be executed and exported to HTML. The index.md and README.md files will be updated, using their template files in the *assets* directory, to include a table with all the reports available and their timestamps. The source notebooks will then be cleared of their outputs and all changes will be commited to Git.
Any Jupyter notebook in the ***source*** directory will be assumed to be a report and will be executed and exported to HTML. The index.md and README.md files will be updated, using their respective template files in the ***assets*** directory, to include a table with all the reports available and their timestamps. The source notebooks will then be cleared of their outputs and all changes will be commited to Git.

Report templates are included in the `assets/notebook` folder. Moving them to the source folder will enable them for execution.

To use the optional Discord bot, run

```
python bot.py discord
```

Alternatively, to use the optional Telegram bot, run

```
python bot.py telegram
```

Both `yugiquery.py` and `bot.py` accept command line arguments. Using `-h` or `--help` will print an useful help message listing the parameters that can be passed and their usage. It is also possible to call the script directly as an executable using `./`, although that may be OS dependant.

Further use cases can be found in the [documentation](#documentation).

## Installation

YugiQuery is meant to be user friendly to users without much coding experience. Provided you have Python and Git installed, upon first execution YugiQuery will try to install all its dependencies. If the operation is not succesfull, the user may try to install the dependencies manually relying on the install.sh script. A pip requirements.txt file is also provided, but it does not install every dependency installed by the install.sh script.
YugiQuery is meant to be user friendly to users without much coding experience. Provided you have Python and Git installed, upon first execution YugiQuery will try to install all its dependencies. If the operation is not succesfull, the user may try to install the dependencies manually, relying on the `install.sh` script and the pip `requirements.txt` file provided. The `install.sh`` script also install a nbconvert template which adds dynamic light and dark modes to the exported html report. This is the default template used by YugiQuery. In case it cannot be installed, the user should change the selected template on each report notebook.

Further details can be found the [documentation](#documentation).

## Repository hierarchy

The repository is structured such that its root contains the web page source files while the actual executable files are kept in the *source* directory. Any template files and files used for reference such as dictionaries are kept in the *assets* directory. The raw data is saved in the *data* directory and the ReadTheDocs source files are kept the *docs* directory. Below is an example of the basic structure of the directory.
The repository is structured such that its root contains the web page source files, while the actual executable files are kept in the ***source*** directory. Any template files (markdown, nbconvert, notebook, etc) and files used for reference such as dictionaries are kept in the ***assets*** directory. The raw data used by the reports is saved in the ***data*** directory. The *Read The Docs* source files are kept in the ***docs*** directory. Below is an skeleton of the directory structure.

```
yugiquery/
├─ assets/
│ ├─ colors/
│ ├─ dates.json
│ ├─ footer.md
│ ├─ json/
│ │ ├─ colors.json
│ │ ├─ dates.json
│ │ ├─ rarities.json
│ │ └─ regions.json
│ ├─ markdown/
│ │ ├─ footer.md
│ │ ├─ header.md
│ │ ├─ index.md
│ │ └─ REAMDME.md
│ ├─ nbconvert/
│ │ ├─ conf.json
│ │ ├─ dynamic.css
│ │ └─ index.html.j2
│ ├─ notebook/
│ │ └─ Template.ipynb
│ ├─ Gateway.html
│ ├─ header.md
│ ├─ index.md
│ ├─ rarities.json
│ ├─ README.md
│ ├─ regions.json
│ ├─ secrets.env
│ └─ Template.ipynb
│ └─ secrets.env
├─ data/
│ ├─ benchmark.json
│ ├─ data.csv
│ └─ data_changelog.csv
│ ├─ report_data.csv
│ └─ report_changelog.csv
├─ docs/
│ ├─ bot.rst
│ ├─ Makefile
│ ├─ make.bat
│ ├─ conf.py
│ ├─ index.rst
│ ├─ bot.rst
│ └─ yugiquery.rst
├─ source/
│ ├─ bot.py
│ ├─ install.sh
│ ├─ Report.ipynb
│ ├─ requirements.txt
│ ├─ Report.ipynb
│ ├─ bot.py
│ └─ yugiquery.py
├─ _config.yml
├─ .devcontainer.json
├─ .readthedocs.yaml
├─ index.md
├─ LICENSE.md
├─ README.md
├─ Report.html
└─ _config.yml
└─ Report.html
```

Ideally, files in the *assets* directory should be read-only files exclusively for reference. Files in the *data* directory are read and write files for the generation of the reports. The root of the repository should only contain files intended for the web page generation by GitHub pages or files that cannot be in another location.
Ideally, files in the ***assets*** directory should be read-only files exclusively for reference. Files in the ***data*** directory are read and write files for the generation of the reports. The root of the repository should only contain files intended for the web page generation by GitHub pages or files that cannot be in another location.

## Documentation

The documentation can be found at [ReadTheDocs](https://yugiquery.readthedocs.io/en/latest/)

## Known limitations

At present, python<3.11 is needed to install all dependencies. This will be fixed once `TQDM` changes its Discord integration from the deprecated `disco-py` to `discord.py`
At present, `TQDM` relies on the deprecated `disco-py` package which won't build. To circunvent this problem until the official`TQDM` release drops the `disco-py` dependency, we install `TQDM` from [this fork](https://github.com/guigoruiz1/tqdm), which uses pure REST API and/or `discord.py`.

Recent updates to `IPython` broke `HALO` in Jupyter notebooks. Until `HALO` conforms to the new IPython API, we install it from [this fork](https://github.com/guigoruiz1/halo).

---

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions assets/nbconvert/conf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"base_template": "lab",
"mimetypes": {
"text/html": true
},
"preprocessors": {
"100-TagRemovePreprocessor": {
"type": "nbconvert.preprocessors.TagRemovePreprocessor",
"enabled": true,
"remove_cell_tags": ["exclude"]
}
}
}
Loading

0 comments on commit d972169

Please sign in to comment.