Project:Procedure: Difference between revisions

From Wittgenstein Nachlass Graphics
(Created page with "== One-time == * Remove subdirectories of directory <code>images</code> (see $wgHashedUploadDirectory) * Configure User:Nachlass Graphics Bot == For each Ms or Ts == * Upload files (PNGs and SVGs) using importImages.php * Generate description pages: ** Download HTML source cose of the relevant Ms or Ts and substitute single quotes ** Create file <code>descriptions.txt</code> by running custom scr...")
 
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
== One-time ==
== Drawings ==
=== One-time ===


* Remove subdirectories of directory <code>images</code> (see [[mw:Manual:$wgHashedUploadDirectory|$wgHashedUploadDirectory]])
* Remove subdirectories of directory <code>images</code> (see [[mw:Manual:$wgHashedUploadDirectory|$wgHashedUploadDirectory]]) '''Done'''
* Configure [[User:Nachlass Graphics Bot]]
* Configure [[User:Nachlass Graphics Bot]]<ref>pywikibot installed in <code>/home/michele/.local/bin</code></ref> '''Done'''


== For each Ms or Ts ==
=== For each Ms or Ts ===
* Upload files (PNGs and SVGs) using [[mw:Manual:importImages.php|importImages.php]]
* Upload files (PNGs and SVGs) using [[mw:Manual:importImages.php|importImages.php]]: in wiki root directory run <code><nowiki>sudo php maintenance/importImages.php import --comment="{{Graphic}}" --summary="{{Graphic}}" --user="MLavazza" --limit=1</nowiki></code>
* Generate description pages:
* Generate description pages:
** Download HTML source cose of the relevant Ms or Ts and substitute single quotes
** Download HTML source code of the relevant Ms or Ts and substitute single quotes
** Create file <code>descriptions.txt</code> by running custom script <code>process.php</code> on local machine
** Create file <code>descriptions.txt</code> by running custom script <code>process.php</code> on local machine
* Add description pages using [[mw:Manual:Pywikibot/pagefromfile.py|pagefromfile.py]] (with <code>-appendbottom</code>)
* Add description pages using [[mw:Manual:Pywikibot/pagefromfile.py|pagefromfile.py]]: in <code>~/Documents/pywikibot/</code> run <code>sudo python3 pwb.py pagefromfile -notitle -showdiff -force -putthrottle:2 -file:/home/michele/Documents/Nachlass\ Graphics\ website/Description\ files/pages.txt</code>
 
== Figures ==
Because html2image is installed in a virtual environment, for it to work, before lauching a Python file such as <code>take-screenshots-loop.py</code>, the venv must be activated by navigating to <code>~/.local/share/pipx/venvs/html2image/bin</code> and running <code>source ./activate</code>
 
Then, it is possible to navigate to the folder where the Python file is and launch it with <code>python3 take-screenshots-loop.py</code>
 
To upload the files thus generated, upload them to the <code>w/import</code> folder on the server and using SSH, in the wiki root, run <code>sudo php maintenance/importImages.php import --comment="" --summary="individual figures based on transcription HTML" --user="MLavazza" --limit=1 --overwrite</code>
 
== Notes ==
<references/>
 
[[Category:Documentation]]

Latest revision as of 16:31, 13 October 2024

Drawings

One-time

For each Ms or Ts

  • Upload files (PNGs and SVGs) using importImages.php: in wiki root directory run sudo php maintenance/importImages.php import --comment="{{Graphic}}" --summary="{{Graphic}}" --user="MLavazza" --limit=1
  • Generate description pages:
    • Download HTML source code of the relevant Ms or Ts and substitute single quotes
    • Create file descriptions.txt by running custom script process.php on local machine
  • Add description pages using pagefromfile.py: in ~/Documents/pywikibot/ run sudo python3 pwb.py pagefromfile -notitle -showdiff -force -putthrottle:2 -file:/home/michele/Documents/Nachlass\ Graphics\ website/Description\ files/pages.txt

Figures

Because html2image is installed in a virtual environment, for it to work, before lauching a Python file such as take-screenshots-loop.py, the venv must be activated by navigating to ~/.local/share/pipx/venvs/html2image/bin and running source ./activate

Then, it is possible to navigate to the folder where the Python file is and launch it with python3 take-screenshots-loop.py

To upload the files thus generated, upload them to the w/import folder on the server and using SSH, in the wiki root, run sudo php maintenance/importImages.php import --comment="" --summary="individual figures based on transcription HTML" --user="MLavazza" --limit=1 --overwrite

Notes

  1. pywikibot installed in /home/michele/.local/bin