diff --git a/README.md b/README.md index dc92bae..d30dfbe 100644 --- a/README.md +++ b/README.md @@ -3515,4 +3515,3 @@ Index ----- * **Only available in [PDF](https://transactions.sendowl.com/products/78175486/4422834F/view).** * **Ctrl+F / ⌘F is usually sufficient.** -* **Searching `'#'` will limit the search to the titles.** diff --git a/index.html b/index.html index 98c0795..41ac3de 100644 --- a/index.html +++ b/index.html @@ -1013,10 +1013,10 @@ Z = dataclasses.make_dataclass(<span class="hljs-string">'Z'</span>, [<span clas <li><strong>Function field() is needed because <code class="python hljs"><span class="hljs-string">'<attr_name>: list = []'</span></code> would make a list that is shared among all instances.</strong></li> <li><strong>Default_factory can be any <a href="#callable">callable</a>.</strong></li> </ul> -<div><h4 id="inline-1">Inline:</h4><pre><code class="python language-python hljs"><code class="python language-python hljs"><span class="hljs-keyword">from</span> dataclasses <span class="hljs-keyword">import</span> make_dataclass +<div><h4 id="inline-1">Inline:</h4><pre><code class="python language-python hljs"><span class="hljs-keyword">from</span> dataclasses <span class="hljs-keyword">import</span> make_dataclass <class> = make_dataclass(<span class="hljs-string">'<class_name>'</span>, <coll_of_attribute_names>) <class> = make_dataclass(<span class="hljs-string">'<class_name>'</span>, <coll_of_tuples>) -<tuple> = (<span class="hljs-string">'<attr_name>'</span>, <type> [, <default_value>])</code></code></pre></div> +<tuple> = (<span class="hljs-string">'<attr_name>'</span>, <type> [, <default_value>])</code></pre></div> <div><h3 id="slots">Slots</h3><p><strong>Mechanism that restricts objects to attributes listed in 'slots' and significantly reduces their memory footprint.</strong></p><pre><code class="python language-python hljs"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyClassWithSlots</span>:</span> __slots__ = [<span class="hljs-string">'a'</span>] @@ -1905,7 +1905,7 @@ param_names = list(<sig>.parameters.keys()) param_kinds = [a.kind <span class="hljs-keyword">for</span> a <span class="hljs-keyword">in</span> <sig>.parameters.values()] </code></pre></div> -<div><h2 id="metaprograming"><a href="#metaprograming" name="metaprograming">#</a>Metaprograming</h2><p><strong>Code that generates code.</strong></p><div><h3 id="type-1">Type</h3><p><strong>Type is the root class. If only passed an object it returns its type (class). Otherwise it creates a new class.</strong></p><pre><code class="python language-python hljs"><code class="python language-python hljs"><class> = type(<span class="hljs-string">'<class_name>'</span>, <parents_tuple>, <attributes_dict>)</code></code></pre></div></div> +<div><h2 id="metaprograming"><a href="#metaprograming" name="metaprograming">#</a>Metaprograming</h2><p><strong>Code that generates code.</strong></p><div><h3 id="type-1">Type</h3><p><strong>Type is the root class. If only passed an object it returns its type (class). Otherwise it creates a new class.</strong></p><pre><code class="python language-python hljs"><class> = type(<span class="hljs-string">'<class_name>'</span>, <parents_tuple>, <attributes_dict>)</code></pre></div></div> @@ -2944,12 +2944,12 @@ cdef <type/void> <func_name>(<type> <arg_name_1>, ...): </code></pre> <pre><code class="python language-python hljs">cdef enum <enum_name>: <member_name_1>, <member_name_2>, ... </code></pre> -<div><h3 id="pyinstaller">PyInstaller</h3><pre><code class="bash language-bash hljs"><code class="bash language-bash hljs">$ pip3 install pyinstaller +<div><h3 id="pyinstaller">PyInstaller</h3><pre><code class="bash language-bash hljs">$ pip3 install pyinstaller $ pyinstaller script.py <span class="hljs-comment"># Compiles into './dist/script' directory.</span> $ pyinstaller script.py --onefile <span class="hljs-comment"># Compiles into './dist/script' console app.</span> $ pyinstaller script.py --windowed <span class="hljs-comment"># Compiles into './dist/script' windowed app.</span> $ pyinstaller script.py --add-data '<path>:.' <span class="hljs-comment"># Adds file to the root of the executable.</span> -</code></code></pre></div> +</code></pre></div> <ul> <li><strong>File paths need to be updated to <code class="python hljs"><span class="hljs-string">'os.path.join(sys._MEIPASS, <path>)'</span></code>.</strong></li> @@ -2983,8 +2983,7 @@ $ pyinstaller script.py --add-data '<path>:.' <span class="hljs-comment"> main() </code></pre></div> -<div><h2 id="index"><a href="#index" name="index">#</a>Index</h2><ul> -<li><strong>Only available in <a href="https://transactions.sendowl.com/products/78175486/4422834F/view">PDF</a>.</strong></li> +<div><h2 id="index"><a href="#index" name="index">#</a>Index</h2><ul><li><strong>Only available in <a href="https://transactions.sendowl.com/products/78175486/4422834F/view">PDF</a>.</strong></li> <li><strong>Ctrl+F / ⌘F is usually sufficient.</strong></li> <li><strong>Searching <code class="python hljs"><span class="hljs-string">'#<title>'</span></code> will limit the search to the titles.</strong></li> </ul></div> diff --git a/parse.js b/parse.js index f4eebcd..bac2cee 100755 --- a/parse.js +++ b/parse.js @@ -55,24 +55,25 @@ const LRU_CACHE = ' <span class="hljs-keyword">return</span> n <span class="hljs-keyword">if</span> n < <span class="hljs-number">2</span> <span class="hljs-keyword">else</span> fib(n-<span class="hljs-number">2</span>) + fib(n-<span class="hljs-number">1</span>)\n'; const TYPE = - '<code class="python language-python hljs"><class> = type(<span class="hljs-string">\'<class_name>\'</span>, <parents_tuple>, <attributes_dict>)</code>'; + '<class> = type(<span class="hljs-string">\'<class_name>\'</span>, <parents_tuple>, <attributes_dict>)'; const DATACLASS = - '<code class="python language-python hljs"><span class="hljs-keyword">from</span> dataclasses <span class="hljs-keyword">import</span> make_dataclass\n' + + '<span class="hljs-keyword">from</span> dataclasses <span class="hljs-keyword">import</span> make_dataclass\n' + '<class> = make_dataclass(<span class="hljs-string">\'<class_name>\'</span>, <coll_of_attribute_names>)\n' + '<class> = make_dataclass(<span class="hljs-string">\'<class_name>\'</span>, <coll_of_tuples>)\n' + - '<tuple> = (<span class="hljs-string">\'<attr_name>\'</span>, <type> [, <default_value>])</code>'; - -const DATETIME = - '<code class="python language-python hljs"><span class="hljs-string">\'<DT> = resolve_imaginary(<DT>)\'</span></code>'; + '<tuple> = (<span class="hljs-string">\'<attr_name>\'</span>, <type> [, <default_value>])'; const PYINSTALLER = - '<code class="bash language-bash hljs">$ pip3 install pyinstaller\n' + + '$ pip3 install pyinstaller\n' + '$ pyinstaller script.py <span class="hljs-comment"># Compiles into \'./dist/script\' directory.</span>\n' + '$ pyinstaller script.py --onefile <span class="hljs-comment"># Compiles into \'./dist/script\' console app.</span>\n' + '$ pyinstaller script.py --windowed <span class="hljs-comment"># Compiles into \'./dist/script\' windowed app.</span>\n' + - '$ pyinstaller script.py --add-data \'<path>:.\' <span class="hljs-comment"># Adds file to the root of the executable.</span>\n' + - '</code>' + '$ pyinstaller script.py --add-data \'<path>:.\' <span class="hljs-comment"># Adds file to the root of the executable.</span>\n'; + +const INDEX = + '<li><strong>Only available in <a href="https://transactions.sendowl.com/products/78175486/4422834F/view">PDF</a>.</strong></li>\n' + + '<li><strong>Ctrl+F / ⌘F is usually sufficient.</strong></li>\n' + + '<li><strong>Searching <code class="python hljs"><span class="hljs-string">\'#<title>\'</span></code> will limit the search to the titles.</strong></li>\n'; const DIAGRAM_1_A = '+------------------+------------+------------+------------+\n' + @@ -501,8 +502,8 @@ function fixHighlights() { $(`code:contains(@lru_cache(maxsize=None))`).html(LRU_CACHE); $(`code:contains(\'<class_name>\', <parents_tuple>, <attributes_dict>)`).html(TYPE); $(`code:contains(make_dataclass(\'<class_name>\')`).html(DATACLASS); - $(`code:contains((<DT>))`).html(DATETIME); $(`code:contains(pip3 install pyinstaller)`).html(PYINSTALLER); + $(`ul:contains(Only available in)`).html(INDEX); } function preventPageBreaks() {