![]() ![]() shell_commands = """ \ #! /bin/zsh scriptdir=$( cd $(dirname "$0") pwd -P ) source ~/.zshrc dockrun_t3rd makehtml -c jobfile /PROJECT/Documentation/jobfile.json """ def rebuild (): if debug : print ( 'rebuilding.' ) for fpath in : if ospe ( fpath ): os. # Instead of having an extra file make changes directly here. dumps ( M, indent = 2, sort_keys = True )) # In my system shell startup file (~/.zshrc, ~/.bashrc) I have a line: # source ~/.dockrun/dockrun_t3rd/shell-commands.sh # And, for a new container version I provide that once: # docker run -rm t3docs/render-documentation:v2.3.0 \ # show-shell-commands \ # > ~/.dockrun/dockrun_t3rd/shell-commands.sh # The following `shell_commands` is what would be the contents of a shell script. chdir ( M ) if debug : print ( 'debug info:' ) print ( json. exit () print ( 'run with -help for help' ) print ( 'press CTRL C to stop' ) debug = '-debug' in sys. live_css s9 = s_live_css = True # memory M =. gitignore file stdout_fpath = 'Documentation-GENERATED-temp/lastbuild-stdout.txt' stderr_fpath = 'Documentation-GENERATED-temp/lastbuild-stderr.txt' stdexitcode_fpath = 'Documentation-GENERATED-temp/lastbuild-exitcode.txt' # server params # def serve(self, port=5500, liveport=None, host=None, root=None, debug=None, # open_url=False, restart_delay=2, open_url_delay=None, # live_css=True): # port - for serving s1 = s_port = 8080 # liveport - default is 35729 s2 = s_liveport = 35729 # host - domain for serving s3 = s_host = 'localhost' # root - our webroot folder s4 = s_webroot = 'Documentation-GENERATED-temp/Result/project/0.0.0' # debug - Automatic restart when script changes? s5 = s_debug = None # open_url - DEPRECATED s6 = s_open_url = False # restart_delay s7 = s_restart_delay = 2 # automatically open browser from $BROWSER once s8 = s_open_url_delay = 2.0 # 2 seconds # 9. # I have installed the Python livereload package for me as a user: # pip install -user -upgrade pylivereload # As on Linux I installed the Python pyinotify package: # pip install -user -upgrade pyinotify import json import os import sys from livereload import Server from os.path import exists as ospe, join as ospj from subprocess import PIPE, run # Tip: Add line `*GENERATED*` to your (global?!). Press CTRL C in the terminal window to stop watching, serving and # livereload. Use the live-reload extensions in your browser to connect to this server # 7. Wait until the script is not building but only watching. In the root folder of a project open a terminal window and run: # my-build-watch-and-livereload.py # 5. Make the script executable: # chmod x ~/bin/my-build-watch-and-livereload.py # 4. Save the script to a location that is in your path like ~/bin # 3. Name this script 'my-build-watch-and-livereload.py' # 2. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. #! /usr/bin/env python3 # coding: utf-8 # my-build-watch-and-livereload.py, mb, 12:21 # MIT license # Copyright 2019 Martin Bless # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. Add start command to PhpStorm or P圜harm.Decode Sphinx crossreferencing inventories ‘objects.inv’. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |