From 9ae7a12cd8c5274771314b3613f81efeabd2e964 Mon Sep 17 00:00:00 2001 From: Dheshan M Date: Fri, 18 Oct 2019 18:53:39 +0530 Subject: [PATCH] Create README.md --- README.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..b4536cb --- /dev/null +++ b/README.md @@ -0,0 +1,40 @@ +# Djangify +A Python script that converts HTML Files / Templates to Django compatible HTML Templates. + +## Usage Info + + username@hostname $ ./djangify.py -h + usage: djangify.py [-h] [-d [BASE_DIRECTORY]] [-a [APP_NAME]] [f [f ...]] + + Converts specified html files or all html files to django format within a + specified directory. + + positional arguments: + f provide file names to convert + + optional arguments: + -h, --help show this help message and exit + -d [BASE_DIRECTORY] Provide base directory + -a [APP_NAME] provide django app name + +## Description +Converts all the HTML files specified in the files (' f ') argument into Django templates, replacing the contents of 'src', 'href' and 'url' tags with their Django compatible static conterparts with their Django App name prefixed. + +#### For Example: +To process a set of HTML files, copy the djangify.py script to the directory containing these HTML files, and run the following command, (Here 'blog' refers to the App name for which we are processing these files) + + $ ./djangify.py -a blog + +This command will replace all local files referenced in 'src', 'href' and 'url' tags in the following way : + +Original : +```python + +
  • Register
  • +``` + +After script execution : + ```python + +
  • Register
  • +```