From f30215ffe9cc18de08a89fd49c03cbc860f23849 Mon Sep 17 00:00:00 2001 From: Solomon Laing Date: Wed, 2 Jun 2021 18:17:11 +0930 Subject: [PATCH] Initial commit --- .devcontainer/devcontainer.json | 34 ++++ .env | 2 + Dockerfile | 17 ++ Pipfile | 25 +++ Pipfile.lock | 167 ++++++++++++++++++ __pycache__/app.cpython-38.pyc | Bin 0 -> 2243 bytes __pycache__/gunicorn_config.cpython-38.pyc | Bin 0 -> 150 bytes __pycache__/main.cpython-38.pyc | Bin 0 -> 2292 bytes __pycache__/wsgi.cpython-38.pyc | Bin 0 -> 224 bytes app.py | 101 +++++++++++ codehilite_styles.css | 74 ++++++++ gunicorn_config.py | 4 + .../2021-06-02_uncategorised_example-copy.md | 15 ++ posts/2021-06-02_uncategorised_example.md | 15 ++ requirements.txt | 14 ++ wsgi.py | 4 + 16 files changed, 472 insertions(+) create mode 100644 .devcontainer/devcontainer.json create mode 100644 .env create mode 100644 Dockerfile create mode 100644 Pipfile create mode 100644 Pipfile.lock create mode 100644 __pycache__/app.cpython-38.pyc create mode 100644 __pycache__/gunicorn_config.cpython-38.pyc create mode 100644 __pycache__/main.cpython-38.pyc create mode 100644 __pycache__/wsgi.cpython-38.pyc create mode 100644 app.py create mode 100644 codehilite_styles.css create mode 100644 gunicorn_config.py create mode 100644 posts/2021-06-02_uncategorised_example-copy.md create mode 100644 posts/2021-06-02_uncategorised_example.md create mode 100644 requirements.txt create mode 100644 wsgi.py diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..f8a19ba --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,34 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: +// https://github.com/microsoft/vscode-dev-containers/tree/v0.177.0/containers/docker-existing-dockerfile +{ + "name": "Existing Dockerfile", + + // Sets the run context to one level up instead of the .devcontainer folder. + "context": "..", + + // Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename. + "dockerFile": "../Dockerfile", + + // Set *default* container specific settings.json values on container create. + "settings": { + "terminal.integrated.shell.linux": null + }, + + // Add the IDs of extensions you want installed when the container is created. + "extensions": [] + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Uncomment the next line to run commands after the container is created - for example installing curl. + // "postCreateCommand": "apt-get update && apt-get install -y curl", + + // Uncomment when using a ptrace-based debugger like C++, Go, and Rust + // "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ], + + // Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker. + // "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ], + + // Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root. + // "remoteUser": "vscode" +} diff --git a/.env b/.env new file mode 100644 index 0000000..4f1648e --- /dev/null +++ b/.env @@ -0,0 +1,2 @@ +FLASK_APP=wsgi.py +FLASK_ENV=production \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ddec06d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM python:3.8 + +RUN pip3 install pipenv gunicorn + +ENV PROJECT_DIR /usr/src/simpleblogapi + +WORKDIR ${PROJECT_DIR} + +COPY Pipfile . +COPY Pipfile.lock . +COPY . . + +RUN pipenv install --deploy --ignore-pipfile + +EXPOSE 5400 + +CMD ["gunicorn", "-c", "gunicorn_config.py", "wsgi:api"] diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..5ea0302 --- /dev/null +++ b/Pipfile @@ -0,0 +1,25 @@ +[[source]] +url = "https://pypi.python.org/simple" +verify_ssl = true +name = "pypi" + +[packages] +aniso8601 = "==9.0.1" +beautifulsoup4 = "==4.9.3" +click = "==8.0.1" +Flask = "==2.0.1" +Flask-RESTful = "==0.3.9" +gunicorn = "==20.1.0" +itsdangerous = "==2.0.1" +Jinja2 = "==3.0.1" +Markdown = "==3.3.4" +MarkupSafe = "==2.0.1" +pytz = "==2021.1" +six = "==1.16.0" +soupsieve = "==2.2.1" +Werkzeug = "==2.0.1" + +[dev-packages] + +[requires] +python_version = "3.8" diff --git a/Pipfile.lock b/Pipfile.lock new file mode 100644 index 0000000..5f918b2 --- /dev/null +++ b/Pipfile.lock @@ -0,0 +1,167 @@ +{ + "_meta": { + "hash": { + "sha256": "1f2f1fa75a1a8db97c488933c428682f572753a70537fad42a0ee1f69c73927c" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "3.8" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.python.org/simple", + "verify_ssl": true + } + ] + }, + "default": { + "aniso8601": { + "hashes": [ + "sha256:1d2b7ef82963909e93c4f24ce48d4de9e66009a21bf1c1e1c85bdd0812fe412f", + "sha256:72e3117667eedf66951bb2d93f4296a56b94b078a8a95905a052611fb3f1b973" + ], + "index": "pypi", + "version": "==9.0.1" + }, + "beautifulsoup4": { + "hashes": [ + "sha256:4c98143716ef1cb40bf7f39a8e3eec8f8b009509e74904ba3a7b315431577e35", + "sha256:84729e322ad1d5b4d25f805bfa05b902dd96450f43842c4e99067d5e1369eb25", + "sha256:fff47e031e34ec82bf17e00da8f592fe7de69aeea38be00523c04623c04fb666" + ], + "index": "pypi", + "version": "==4.9.3" + }, + "click": { + "hashes": [ + "sha256:8c04c11192119b1ef78ea049e0a6f0463e4c48ef00a30160c704337586f3ad7a", + "sha256:fba402a4a47334742d782209a7c79bc448911afe1149d07bdabdf480b3e2f4b6" + ], + "index": "pypi", + "version": "==8.0.1" + }, + "flask": { + "hashes": [ + "sha256:1c4c257b1892aec1398784c63791cbaa43062f1f7aeb555c4da961b20ee68f55", + "sha256:a6209ca15eb63fc9385f38e452704113d679511d9574d09b2cf9183ae7d20dc9" + ], + "index": "pypi", + "version": "==2.0.1" + }, + "flask-restful": { + "hashes": [ + "sha256:4970c49b6488e46c520b325f54833374dc2b98e211f1b272bd4b0c516232afe2", + "sha256:ccec650b835d48192138c85329ae03735e6ced58e9b2d9c2146d6c84c06fa53e" + ], + "index": "pypi", + "version": "==0.3.9" + }, + "gunicorn": { + "hashes": [ + "sha256:9dcc4547dbb1cb284accfb15ab5667a0e5d1881cc443e0677b4882a4067a807e", + "sha256:e0a968b5ba15f8a328fdfd7ab1fcb5af4470c28aaf7e55df02a99bc13138e6e8" + ], + "index": "pypi", + "version": "==20.1.0" + }, + "itsdangerous": { + "hashes": [ + "sha256:5174094b9637652bdb841a3029700391451bd092ba3db90600dea710ba28e97c", + "sha256:9e724d68fc22902a1435351f84c3fb8623f303fffcc566a4cb952df8c572cff0" + ], + "index": "pypi", + "version": "==2.0.1" + }, + "jinja2": { + "hashes": [ + "sha256:1f06f2da51e7b56b8f238affdd6b4e2c61e39598a378cc49345bc1bd42a978a4", + "sha256:703f484b47a6af502e743c9122595cc812b0271f661722403114f71a79d0f5a4" + ], + "index": "pypi", + "version": "==3.0.1" + }, + "markdown": { + "hashes": [ + "sha256:31b5b491868dcc87d6c24b7e3d19a0d730d59d3e46f4eea6430a321bed387a49", + "sha256:96c3ba1261de2f7547b46a00ea8463832c921d3f9d6aba3f255a6f71386db20c" + ], + "index": "pypi", + "version": "==3.3.4" + }, + "markupsafe": { + "hashes": [ + "sha256:01a9b8ea66f1658938f65b93a85ebe8bc016e6769611be228d797c9d998dd298", + "sha256:023cb26ec21ece8dc3907c0e8320058b2e0cb3c55cf9564da612bc325bed5e64", + "sha256:0446679737af14f45767963a1a9ef7620189912317d095f2d9ffa183a4d25d2b", + "sha256:0717a7390a68be14b8c793ba258e075c6f4ca819f15edfc2a3a027c823718567", + "sha256:0955295dd5eec6cb6cc2fe1698f4c6d84af2e92de33fbcac4111913cd100a6ff", + "sha256:10f82115e21dc0dfec9ab5c0223652f7197feb168c940f3ef61563fc2d6beb74", + "sha256:1d609f577dc6e1aa17d746f8bd3c31aa4d258f4070d61b2aa5c4166c1539de35", + "sha256:2ef54abee730b502252bcdf31b10dacb0a416229b72c18b19e24a4509f273d26", + "sha256:3c112550557578c26af18a1ccc9e090bfe03832ae994343cfdacd287db6a6ae7", + "sha256:47ab1e7b91c098ab893b828deafa1203de86d0bc6ab587b160f78fe6c4011f75", + "sha256:49e3ceeabbfb9d66c3aef5af3a60cc43b85c33df25ce03d0031a608b0a8b2e3f", + "sha256:4efca8f86c54b22348a5467704e3fec767b2db12fc39c6d963168ab1d3fc9135", + "sha256:53edb4da6925ad13c07b6d26c2a852bd81e364f95301c66e930ab2aef5b5ddd8", + "sha256:594c67807fb16238b30c44bdf74f36c02cdf22d1c8cda91ef8a0ed8dabf5620a", + "sha256:611d1ad9a4288cf3e3c16014564df047fe08410e628f89805e475368bd304914", + "sha256:6557b31b5e2c9ddf0de32a691f2312a32f77cd7681d8af66c2692efdbef84c18", + "sha256:693ce3f9e70a6cf7d2fb9e6c9d8b204b6b39897a2c4a1aa65728d5ac97dcc1d8", + "sha256:6a7fae0dd14cf60ad5ff42baa2e95727c3d81ded453457771d02b7d2b3f9c0c2", + "sha256:6c4ca60fa24e85fe25b912b01e62cb969d69a23a5d5867682dd3e80b5b02581d", + "sha256:7d91275b0245b1da4d4cfa07e0faedd5b0812efc15b702576d103293e252af1b", + "sha256:905fec760bd2fa1388bb5b489ee8ee5f7291d692638ea5f67982d968366bef9f", + "sha256:97383d78eb34da7e1fa37dd273c20ad4320929af65d156e35a5e2d89566d9dfb", + "sha256:984d76483eb32f1bcb536dc27e4ad56bba4baa70be32fa87152832cdd9db0833", + "sha256:a30e67a65b53ea0a5e62fe23682cfe22712e01f453b95233b25502f7c61cb415", + "sha256:ab3ef638ace319fa26553db0624c4699e31a28bb2a835c5faca8f8acf6a5a902", + "sha256:b2f4bf27480f5e5e8ce285a8c8fd176c0b03e93dcc6646477d4630e83440c6a9", + "sha256:b7f2d075102dc8c794cbde1947378051c4e5180d52d276987b8d28a3bd58c17d", + "sha256:be98f628055368795d818ebf93da628541e10b75b41c559fdf36d104c5787066", + "sha256:d7f9850398e85aba693bb640262d3611788b1f29a79f0c93c565694658f4071f", + "sha256:f5653a225f31e113b152e56f154ccbe59eeb1c7487b39b9d9f9cdb58e6c79dc5", + "sha256:f826e31d18b516f653fe296d967d700fddad5901ae07c622bb3705955e1faa94", + "sha256:f8ba0e8349a38d3001fae7eadded3f6606f0da5d748ee53cc1dab1d6527b9509", + "sha256:f9081981fe268bd86831e5c75f7de206ef275defcb82bc70740ae6dc507aee51", + "sha256:fa130dd50c57d53368c9d59395cb5526eda596d3ffe36666cd81a44d56e48872" + ], + "index": "pypi", + "version": "==2.0.1" + }, + "pytz": { + "hashes": [ + "sha256:83a4a90894bf38e243cf052c8b58f381bfe9a7a483f6a9cab140bc7f702ac4da", + "sha256:eb10ce3e7736052ed3623d49975ce333bcd712c7bb19a58b9e2089d4057d0798" + ], + "index": "pypi", + "version": "==2021.1" + }, + "six": { + "hashes": [ + "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926", + "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254" + ], + "index": "pypi", + "version": "==1.16.0" + }, + "soupsieve": { + "hashes": [ + "sha256:052774848f448cf19c7e959adf5566904d525f33a3f8b6ba6f6f8f26ec7de0cc", + "sha256:c2c1c2d44f158cdbddab7824a9af8c4f83c76b1e23e049479aa432feb6c4c23b" + ], + "index": "pypi", + "markers": "python_version >= '3.0'", + "version": "==2.2.1" + }, + "werkzeug": { + "hashes": [ + "sha256:1de1db30d010ff1af14a009224ec49ab2329ad2cde454c8a708130642d579c42", + "sha256:6c1ec500dcdba0baa27600f6a22f6333d8b662d22027ff9f6202e3367413caa8" + ], + "index": "pypi", + "version": "==2.0.1" + } + }, + "develop": {} +} diff --git a/__pycache__/app.cpython-38.pyc b/__pycache__/app.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c34a57d37cbf695d95023f8f2a113ab3fbff5302 GIT binary patch literal 2243 zcmbVN%Z?m16t!K?uIZk19^}C*4Iw}UW|~C+DH??Y5Me<^C=)g%P*G{SdrIS~>apD< zY1OPI+emx>iynzhzJOog8@xqA$}dDLxYs>NCSe0q%g6V+y6pQn_xihDFCp+;`RunJ zuYvRjDn}n5lxr~buK=8IDoI5%N>OH#RV-sp_M}(&neSv@2344aRg^_loW*V}ke#dp z-vlzrk{g7FJbFNQB%*yUTLC@h9nd>Y@A8DNJRn(*cX5h!cWaP?uVkTjQqOwV zr=^W=3Ej-pNZ443-D#n;*c{B9$Np~MjJ~; z4F2@=!4StVzJQ_s1mJX!8M2@)JD_`BOF7$N>Lz{!z?z2UFK=vt5e)0D@ZHKRn*%oQNFUb$% z|F}B^%jW<76hcBN51v7 zoK39H3j>K50Ztlq-$tXRHlj9-^z{)@DY|xPxZPA@s2kZ-O+AF88$HxzHI-uRj%+4t z#k3q2)9L#3zV#-;AWQTo0EGE831gbjgvB(beUDN6o&75eV^}#{WiflczRKn?#$_Eg z+DxenH$*hf^SY=+p4%kPtA@`c%H2HQofUHVMtuM$I*X6MC0s+w;?S6>m^uA_Rz-le zElKb~Wvm^1q04gsD+Swt`m%)MDolbxs~k~P7o{G;Dgu&N9Yg3N97n)z zkjCl^%4ZQ?LwFtG4TLul&I8yGk`1&=SJVL4kZ0;Ggtq~*0J)>p1zdOs;UdDj2=5`h zkATElg3A!5?o${V4{@}iJ`(3;+C*J8@3<5k<%jwZK030c+uZH@5xn>q#?#EBKEk4X z`XD0$7%p#UqalX2ki7}?vWL(Sx&M&uQNvog4>4}(!aIPzkOuRMw_N27ZXWjH!PfoS z6!!+E8H~%ikb|#p-~47hOGXVB+a(mOfNq_Ld(Z)N+0=TzvTZ84?s~Msral&hnJJ-D zU!hgX0|15>oaaSe7^AcexxnpGre499KJ@zO5xH?s zTG+U5#*LKCUF#_!voOCSi+TqdPob7|4epjTI3^`HgT2CfrkK3!%Vl_x!8r6~6@9_A z`AOG|ha1|cvYuSQrge25E<1F3GV|`}%g=+D1!KG;6*`>toSZ|P4P2-SbFVN`DndAi z;3@$7g+jV4$&aV1H2~{Dx6Aw-v5UEZo!pIk#P(5VS6xNU=~n@|6o03{lbH3_ N`sd>?j!^E>zX65>@S^|# literal 0 HcmV?d00001 diff --git a/__pycache__/gunicorn_config.cpython-38.pyc b/__pycache__/gunicorn_config.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2e5433838ba7789c235e51d3e076823647805c3a GIT binary patch literal 150 zcmWIL<>g`kg2{H<6O@4TV-N=!FakLaKwQiNBvKfn7*ZIc7*m*n88n%zcntKw(8|=r zz~ChlP=TK&(=C>y%)FFa?B)4I*{MavD;bJdfD&Nhmr#0XUS@KBQC@sY}T7@nE^^u|t{w)8`M)KCg6B{7Er0!38|2sqFPHRZAbEgR3+Su(rp%#LYm ztxu`MsS-bcgLCX134Q{{RF_r1z`QD4v35w4uJA<{=5?_? zKP6W9>Ji*+?KWSt_8RZ*Gxdw;et(*;^HUGdPj83Bryqg$B&MeGvB)MmA5P>>H5tQ3 zSY&FSS9eOVz0YJ;@5hdDZj5si-V${+Q3GK@B@V`!s>SvIk6C^kSX_rup9K&kp`0X) zdz^9SK203%!sWhkzp83&$bi8=ojjQK5XL7k>OTQEoiR=3v|&ed<}{Qu2;~RO=1$|l zj@!6%m!su19(OO0nGdrEa{#k{fy_M~aCXFIVG}lf6KG!t4ddZC(zxd!wTEmT9+5-J zqo3Vbt7-9-A=@F1^C|gu_#aQF;Mw%w-@*tbJLF)>+mMaU_Tyl)KZbY;1gT24mB<(Y;;3;;)!x@UqxRccY{N58`lVm4jH4EM@P_lDJ^ zJ53KJnOwY4SKvnL z@)Ep_d&pTFHI^!5cKttP;h}E}7Ca-3mE$X{G#XeuD~%BWx*~1AK`G1`ke-4VeC}8= z_*NVs0TjpF!A=9B0Kzvx6KYp`$D;6#Md3dYMFbKHn&=3+#=+UfT?iy@Z!0Wyh@D>6xYXP=GSh^2j)Od-d4Rw(?&(kJovuVqgV3{B49r)4G zk@j$V?z`~fJs2mI$MpbJd-5P7JQ%ia=%Xf@Hc-70G_wcL61n?;&8TJ#J%k)LbnYBM zV~D-!#a<4o70|9DaTi)ZomXW& zUD?xx+_X(vVOJlDOiz@kV^^V9$^ig|XPl>5nrW?S<8y(>#Z0|`FI{N%FBkWq&rv9QuW3Rw=l%}`w1IfkiWE7uC zoZb5B)5Ip;5I>v>laO?*okH$4d}S5#L1Fe(fN%l9ssek6LJBPefu5)h0ONol5`a8u wW4Yj<#aGx-lX5AhC%iP_)}n`9LoQmggAm$DhHbLTcR-#rZZN$cAP1q$y_s1?lJcI}F1m0y^E3aVXi0xZ_gV+s4!i+@lM8<;Q!5=dZ$G(KRABoX97{6yk26;vd5@Wfz;^5Gkj zD94dju8k?@x@ryQB{%~i>#o`6Nq=*mK&}s%N=wco^__VjpMv|N&y1a{mMmChwKdF3 lX9EkZc1jktvP}UG*flim+}&cj)K+v#t}ygN0yHKm{sR9=Hah?S literal 0 HcmV?d00001 diff --git a/app.py b/app.py new file mode 100644 index 0000000..16b1d9c --- /dev/null +++ b/app.py @@ -0,0 +1,101 @@ +from bs4 import BeautifulSoup +from markdown import markdown +from flask import Flask +from flask_restful import Api, Resource, reqparse +import random +import os + +class Post(Resource): + + def get(self, slug=""): + + path = "./posts" + files = os.listdir(path) + + # general file name format will be: + # __.md + # eg 2021-06-02_projects_my-kubernetes-cluster.md + + if slug == "": + _file = random.choice(files) + tokens = _file.split('_') + + _date = tokens[0] + _category = tokens[1] + _slug = tokens[2].replace('.md', '') + + _post = { + "slug": _slug, + "date": _date, + "category": _category, + "content": render(open(path+'/'+_file, 'r').read()) + } + return _post, 200 + + for _file in files: + tokens = _file.split('_') + + _date = tokens[0] + _category = tokens[1] + _slug = tokens[2].replace('.md', '') + + if(_slug == slug): + _post = { + "slug": _slug, + "date": _date, + "category": _category, + "content": render(open(path+'/'+_file, 'r').read()) + } + return _post, 200 + + return "Post not found", 400 + +class Posts(Resource): + + def get(self, slug=""): + + path = "./posts" + files = os.listdir(path) + posts = [] + + # general file name format will be: + # __.md + # eg 2021-06-02_projects_my-kubernetes-cluster.md + + for _file in files: + tokens = _file.split('_') + + _date = tokens[0] + _category = tokens[1] + _slug = tokens[2].replace('.md', '') + + _post = { + "slug": _slug, + "date": _date, + "category": _category, + "content": render(open(path+'/'+_file, 'r').read()) + } + + posts.append(_post) + + return posts, 200 + + +def render(content): + """Render Markdown Syntax to final HTML.""" + soup = BeautifulSoup(markdown(content, extensions=['codehilite']), features="html.parser") + _add_a_attrs(soup) + return soup.decode() + +def _add_a_attrs(soup): + """Add HTML attrs to our link elements""" + for tag in soup.find_all("a"): + tag['rel'] = "nofollow" + tag['target'] = "_blank" + + +api = Flask(__name__) +_api = Api(api) + +_api.add_resource(Post, "/post/") +_api.add_resource(Posts, "/posts") diff --git a/codehilite_styles.css b/codehilite_styles.css new file mode 100644 index 0000000..fe93c6e --- /dev/null +++ b/codehilite_styles.css @@ -0,0 +1,74 @@ +pre { line-height: 125%; } +td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +.codehilite .hll { background-color: #ffffcc } +.codehilite { background: #f8f8f8; } +.codehilite .c { color: #408080; font-style: italic } /* Comment */ +.codehilite .err { border: 1px solid #FF0000 } /* Error */ +.codehilite .k { color: #008000; font-weight: bold } /* Keyword */ +.codehilite .o { color: #666666 } /* Operator */ +.codehilite .ch { color: #408080; font-style: italic } /* Comment.Hashbang */ +.codehilite .cm { color: #408080; font-style: italic } /* Comment.Multiline */ +.codehilite .cp { color: #BC7A00 } /* Comment.Preproc */ +.codehilite .cpf { color: #408080; font-style: italic } /* Comment.PreprocFile */ +.codehilite .c1 { color: #408080; font-style: italic } /* Comment.Single */ +.codehilite .cs { color: #408080; font-style: italic } /* Comment.Special */ +.codehilite .gd { color: #A00000 } /* Generic.Deleted */ +.codehilite .ge { font-style: italic } /* Generic.Emph */ +.codehilite .gr { color: #FF0000 } /* Generic.Error */ +.codehilite .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.codehilite .gi { color: #00A000 } /* Generic.Inserted */ +.codehilite .go { color: #888888 } /* Generic.Output */ +.codehilite .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ +.codehilite .gs { font-weight: bold } /* Generic.Strong */ +.codehilite .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.codehilite .gt { color: #0044DD } /* Generic.Traceback */ +.codehilite .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ +.codehilite .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ +.codehilite .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ +.codehilite .kp { color: #008000 } /* Keyword.Pseudo */ +.codehilite .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ +.codehilite .kt { color: #B00040 } /* Keyword.Type */ +.codehilite .m { color: #666666 } /* Literal.Number */ +.codehilite .s { color: #BA2121 } /* Literal.String */ +.codehilite .na { color: #7D9029 } /* Name.Attribute */ +.codehilite .nb { color: #008000 } /* Name.Builtin */ +.codehilite .nc { color: #0000FF; font-weight: bold } /* Name.Class */ +.codehilite .no { color: #880000 } /* Name.Constant */ +.codehilite .nd { color: #AA22FF } /* Name.Decorator */ +.codehilite .ni { color: #999999; font-weight: bold } /* Name.Entity */ +.codehilite .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ +.codehilite .nf { color: #0000FF } /* Name.Function */ +.codehilite .nl { color: #A0A000 } /* Name.Label */ +.codehilite .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ +.codehilite .nt { color: #008000; font-weight: bold } /* Name.Tag */ +.codehilite .nv { color: #19177C } /* Name.Variable */ +.codehilite .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ +.codehilite .w { color: #bbbbbb } /* Text.Whitespace */ +.codehilite .mb { color: #666666 } /* Literal.Number.Bin */ +.codehilite .mf { color: #666666 } /* Literal.Number.Float */ +.codehilite .mh { color: #666666 } /* Literal.Number.Hex */ +.codehilite .mi { color: #666666 } /* Literal.Number.Integer */ +.codehilite .mo { color: #666666 } /* Literal.Number.Oct */ +.codehilite .sa { color: #BA2121 } /* Literal.String.Affix */ +.codehilite .sb { color: #BA2121 } /* Literal.String.Backtick */ +.codehilite .sc { color: #BA2121 } /* Literal.String.Char */ +.codehilite .dl { color: #BA2121 } /* Literal.String.Delimiter */ +.codehilite .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ +.codehilite .s2 { color: #BA2121 } /* Literal.String.Double */ +.codehilite .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ +.codehilite .sh { color: #BA2121 } /* Literal.String.Heredoc */ +.codehilite .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ +.codehilite .sx { color: #008000 } /* Literal.String.Other */ +.codehilite .sr { color: #BB6688 } /* Literal.String.Regex */ +.codehilite .s1 { color: #BA2121 } /* Literal.String.Single */ +.codehilite .ss { color: #19177C } /* Literal.String.Symbol */ +.codehilite .bp { color: #008000 } /* Name.Builtin.Pseudo */ +.codehilite .fm { color: #0000FF } /* Name.Function.Magic */ +.codehilite .vc { color: #19177C } /* Name.Variable.Class */ +.codehilite .vg { color: #19177C } /* Name.Variable.Global */ +.codehilite .vi { color: #19177C } /* Name.Variable.Instance */ +.codehilite .vm { color: #19177C } /* Name.Variable.Magic */ +.codehilite .il { color: #666666 } /* Literal.Number.Integer.Long */ diff --git a/gunicorn_config.py b/gunicorn_config.py new file mode 100644 index 0000000..d415b56 --- /dev/null +++ b/gunicorn_config.py @@ -0,0 +1,4 @@ +# to run: gunicorn -c gunicorn_config.py wsgi:api + +bind = "0.0.0.0:5400" +workers = 2 diff --git a/posts/2021-06-02_uncategorised_example-copy.md b/posts/2021-06-02_uncategorised_example-copy.md new file mode 100644 index 0000000..05f1947 --- /dev/null +++ b/posts/2021-06-02_uncategorised_example-copy.md @@ -0,0 +1,15 @@ +## Test Ground + +This is an example of rendering a page of mostly styled html from markdown + +I'm *hoping* that this works. + + + #!python + # Some python script would look like this + print("hello world.") + + +You can also have code inline like `this`. + +[Here](https://www.example.com) is a link for good measure. \ No newline at end of file diff --git a/posts/2021-06-02_uncategorised_example.md b/posts/2021-06-02_uncategorised_example.md new file mode 100644 index 0000000..05f1947 --- /dev/null +++ b/posts/2021-06-02_uncategorised_example.md @@ -0,0 +1,15 @@ +## Test Ground + +This is an example of rendering a page of mostly styled html from markdown + +I'm *hoping* that this works. + + + #!python + # Some python script would look like this + print("hello world.") + + +You can also have code inline like `this`. + +[Here](https://www.example.com) is a link for good measure. \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..b45bd26 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,14 @@ +aniso8601==9.0.1 +beautifulsoup4==4.9.3 +click==8.0.1 +Flask==2.0.1 +Flask-RESTful==0.3.9 +gunicorn==20.1.0 +itsdangerous==2.0.1 +Jinja2==3.0.1 +Markdown==3.3.4 +MarkupSafe==2.0.1 +pytz==2021.1 +six==1.16.0 +soupsieve==2.2.1 +Werkzeug==2.0.1 diff --git a/wsgi.py b/wsgi.py new file mode 100644 index 0000000..320b425 --- /dev/null +++ b/wsgi.py @@ -0,0 +1,4 @@ +from app import api + +if __name__ == '__main__': + api.run(debug=False)