From ea176ea46c8a3eaa9238012b042e19efc21c33b7 Mon Sep 17 00:00:00 2001 From: Jens Kadenbach Date: Tue, 17 Sep 2019 13:55:04 +0200 Subject: [PATCH 1/6] Remove newline to break extension --- config/settings/base.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/config/settings/base.py b/config/settings/base.py index a04f99d..24c4077 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -273,16 +273,9 @@ COMPRESS_PRECOMPILERS = ( # ------------------------------------------------------------------------------ MARKDOWNX_MARKDOWN_EXTENSIONS = [ 'markdown.extensions.extra', - 'markdown.extensions.abbr', - 'markdown.extensions.attr_list', - 'markdown.extensions.def_list', - 'markdown.extensions.fenced_code', - 'markdown.extensions.footnotes', - 'markdown.extensions.tables', 'markdown.extensions.admonition', 'markdown.extensions.codehilite', 'markdown.extensions.meta', - 'markdown.extensions.nl2br', 'markdown.extensions.sane_lists', 'markdown.extensions.smarty', 'markdown.extensions.toc', From 3c3ad875a49b70a05340cbbac104f4754afc0523 Mon Sep 17 00:00:00 2001 From: Jens Kadenbach Date: Tue, 24 Sep 2019 10:12:28 +0200 Subject: [PATCH 2/6] Add truly-sane-lists md extension --- config/settings/base.py | 2 +- requirements/base.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config/settings/base.py b/config/settings/base.py index 24c4077..a7d9a5f 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -276,9 +276,9 @@ MARKDOWNX_MARKDOWN_EXTENSIONS = [ 'markdown.extensions.admonition', 'markdown.extensions.codehilite', 'markdown.extensions.meta', - 'markdown.extensions.sane_lists', 'markdown.extensions.smarty', 'markdown.extensions.toc', 'markdown.extensions.wikilinks', + 'mdx_truly_sane_lists', ] diff --git a/requirements/base.txt b/requirements/base.txt index 94cf8a0..12fd07d 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -20,6 +20,7 @@ djangorestframework==3.10.2 # https://github.com/encode/django-rest-framework coreapi==2.3.3 # https://github.com/core-api/python-client django-markdownx==2.0.28 +mdx_truly_sane_lists==1.2 WeasyPrint==49 django-weasyprint==0.5.4 whitenoise==4.1.3 From ef07dcee59f836fc94a3716932bc5cdbf62e9b74 Mon Sep 17 00:00:00 2001 From: Jens Kadenbach Date: Tue, 24 Sep 2019 11:39:49 +0200 Subject: [PATCH 3/6] Update WeasyPrint and fix test.md --- requirements/base.txt | 2 +- test.md | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index 12fd07d..0c78ba1 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -21,7 +21,7 @@ coreapi==2.3.3 # https://github.com/core-api/python-client django-markdownx==2.0.28 mdx_truly_sane_lists==1.2 -WeasyPrint==49 +WeasyPrint==50 django-weasyprint==0.5.4 whitenoise==4.1.3 Pygments==2.4.2 diff --git a/test.md b/test.md index 3b84530..29e549d 100644 --- a/test.md +++ b/test.md @@ -78,9 +78,9 @@ Adipisicing voluptate ipsum culpa voluptate id aute laboris labore esse fugiat v Deserunt officia esse aliquip consectetur duis ut labore laborum commodo aliquip aliquip velit pariatur dolore. 4. Marionberry 5. Melon - - Cantaloupe - - Honeydew - - Watermelon + - Cantaloupe + - Honeydew + - Watermelon 6. Miracle fruit 7. Mulberry @@ -88,8 +88,8 @@ Adipisicing voluptate ipsum culpa voluptate id aute laboris labore esse fugiat v - Olive - Orange - - Blood orange - - Clementine + - Blood orange + - Clementine - Papaya - Ut aute ipsum occaecat nisi culpa Lorem id occaecat cupidatat id id magna laboris ad duis. Fugiat cillum dolore veniam nostrud proident sint consectetur eiusmod irure adipisicing. - Passionfruit From 44d168e3320bb0cb59fc8ac308e773e0e1918bd8 Mon Sep 17 00:00:00 2001 From: jedi Date: Wed, 25 Sep 2019 14:43:24 +0200 Subject: [PATCH 4/6] wip --- .gitignore | 1 + schickmacher/static/sass/render.scss | 31 ++-- test.md | 224 +++++++++++++++++++++++++-- 3 files changed, 226 insertions(+), 30 deletions(-) diff --git a/.gitignore b/.gitignore index 84e779f..3cbb060 100644 --- a/.gitignore +++ b/.gitignore @@ -183,6 +183,7 @@ typings/ # Gradle: .idea/**/gradle.xml .idea/**/libraries +.idea/ # CMake cmake-build-debug/ diff --git a/schickmacher/static/sass/render.scss b/schickmacher/static/sass/render.scss index 1017fff..193da10 100644 --- a/schickmacher/static/sass/render.scss +++ b/schickmacher/static/sass/render.scss @@ -14,6 +14,7 @@ @bottom-center { content: 'qabel.de'; font-weight: bold; + color: $orange; } @top-center { @@ -32,13 +33,15 @@ z-index: 10; color:white; white-space: nowrap; + //font-size: 1.4em; /*content filled in template*/ } @top-left { z-index: 10; - white-space: nowrap; - color:white; + width: 75%; + color:white;; + font-size: 1.4em; padding-left: 50pt; /*content filled in template*/ } @@ -115,24 +118,14 @@ hr{ border-top: 1px solid black; } -/* -ul { - list-style: none; +table { + width: 100%; + border-collapse:collapse; +} - > li:before { - content: ""; - border-color: transparent $orange; - border-style: solid; - border-width: 0.35em 0 0.35em 0.6em; - margin-top: -0.7em; - display: block; - height: 0; - width: 0; - left: -1em; - top: 1em; - position: relative; - } -}*/ +tr:nth-child(even) { + background-color: #f2f2f2 +} ul { list-style: none; diff --git a/test.md b/test.md index 29e549d..a9b6a6d 100644 --- a/test.md +++ b/test.md @@ -1,3 +1,167 @@ +# Lead Developer + - Jahrgang: 1988 + - Ausbildung: Bachelor of Science Informatik, Leibniz Universität Hannover + +## Fachkenntnisse +### Softwareentwicklung +#### Kernkompetenzen + - Agile Development, Test-Driven-Development + - Reactive Design, Microservices + - Clean Architecture, Domain Driven Development + - OpenSource Lizenzen im kommerziellen Einsatz + +#### Tiefgreifende Erfahrung + - Testmanagement und -automatisierung (xUnit, Selenium, pytest, Espresso, etc) + - Logisches Datenbankdesign, relational und NoSQL (PostgreSQL, MySQL / MariaDB, SQLite, MongoDB, Redis, Elasticsearch) + - Android App-Entwicklung (RxJava, MVVM, Jetpack, Architecture Components, USB-CDC) + - Python (Django, Django-Rest-Framework, Tornado), Kotlin, Java (Spring Boot), PHP (Yii, Zend Framework 3), Ruby (Rails) + - Web-Frontends mit Angular (Material Design, Redux), jQuery, TypeScript, JavaScript + +#### Grundlegende Erfahrung + - Oracle DB, C++ (embedded development), .NET, C#, Haskell, Go + +### Infrastruktur + - Deployment und Integration bei Amazon Web Services (S3, EC2) und Firebase + - Git, SVN, Mercurial + - JetBrains Toolchain (Hub, YouTrack, Teamcity, Upsource), Jenkins, Jira, GoCD, Redmine + - Linux Server, nginx, Docker, Docker-Compose + +### Datenschutz/Datensicherheit + - Privacy by Design in der Praxis, DSGVO-Zusammenhänge + - Implementation intern entwickelter Kryptographieprotokolle, Entwicklung und Review von Kryptographieprotokollen + - Auditierung von Full-Stack Webanwendungen + +### Wissensvermittlung + - Konzeption von Präsentationen und Vorträgen, Durchführung von Präsentationen und Vorträgen + - Entwicklerschulungen, Beratung für Software-Architektur, Security by Design und Teamleitung + +## Weitere Kenntnisse +### Branchen + - Universitäten + - Veranstaltungsbranche + - Medizinbranche + - Büroelektronik + - Telekommunikationsbranche + +### Sprachen + - Deutsch (Muttersprache) + - Englisch (fließend) + +## Ausgewählte Projekte +### 2019 +#### Niedersächsische Tierseuchenkasse, Hannover +Diverse Module einer Website mit Integration von Services Dritter + +Technologien + - PHP 7.2, Zend Framework 3, PHPUnit + - Bootstrap 3, jQuery + - Docker + - MySQL/MariaDB + + +### 2019 +#### Arconic Fastening Systems, Hildesheim +Informationsflussanalyse und Erarbeitung von Optimierungspotenzialen im Kontext von Industrie 4.0 in einem +Hauptfertigungsstandort anhand von Interviews und bestehender Dokumentation + - Interdisziplinäre Zusammenarbeit mit dem Institut für Integrierte Produktion Hannover + +### 2018 +#### Büroelektronik Konzern, Hannover +Implementierung eines Mock-Ups zur Demonstration eines neuen kryptographischen +Konzepts und seiner Anwendungsmöglichkeiten + - Entwicklung eines Mock-Ups +Technologien + - Angular, Clarity Design + +#### Büroelektronik Konzern, Hannover +Privacy Firewall zur Einstufung personenbezogener Daten in +Unternehmensnetzwerken als Teil eines Großprojekts + - Entwicklung einer Server Applikation + - Beratung in den Bereichen Natural Language Processing und KI + - Review der Gesamtarchitektur mit Bezug auf IT-Security und Performance / Skalierung + +Technologien + - Python, MQTT + - spaCy - Industrial Streng Natural Language Processing + +### 2017 - 2018 +#### Softwareentwicklungsbranche, Hannover +Entwicklung einer sicheren Telekommikationslösung mit IoT-Komponenten + - Software-Entwicklung (Android, Embedded, Webserver) + - Leitung eines verteilten und interdisziplinären Teams + +Technologien + - C++ auf ARM32 + - Kotlin, Python, Django + - Angular, Typescript, Clarity Design + - WebSockets, WebRTC + - USB-CDC mit Android Device als USB-Host + - Protobuf, serielle Protokolle + - Docker + +### 2017 +#### Frankiermaschinenhersteller, Berlin +Auditing einer umfangreichen online Software für digitale Signaturen + - Durchführung der Auditierung + - Coaching der Teamleitung (insb. Testing, Teamführung und Kommunikation +mit der Projektleitung) + - Beratung bzgl. Verbesserung der vorhanden Entwicklungsprozesse +hinsichtlich agile Development + +#### Büroelektronik Konzern, Hannover +Entwicklung eines Demonstrators für eine smarte Arbeitsumgebung unter +Berücksichtigung von Privacy-by-design and default Vorgaben + - Software Entwicklung + +Technologien + - MQTT, IoT + - Windows 10 C# .NET App + +#### Büroelektronik Konzern, Hannover +Entwicklung eines Demonstrators zum Einsatz von Attribute-Based-Credentials zur anonymen Authentifizierung und Authorisierung von Mitarbeitern mithilfe von Smart Devices + - Software-Entwicklung + - Konzept-Entwicklung - Attribute-Based-Credentials im Enterprise Umfeld + +Technologien + - Python, Flask + - Angular, Material Design + - Android, Kotlin, AndroidWear (Smartwatches), NFC + +### 2015 - 2016 +#### Qabel GmbH (internes Projekt), Hannover +Kryptographie-Plattform zur sicheren Kommunikation mit Ende-zu-Ende Verschlüsselung und Dokumentenablage in der Amazon Cloud mit Client-Anwendungen für Android und Windows/Mac/Linux + +Technologien + - Java, Kotlin, Android + - Python, Django + - Docker + - Angular + - PostgreSQL, SQLite + +### 2011 - 2014 +#### Event Software Hersteller, Hannover +Entwicklung einer modularen und skalierbaren Webanwendung zur Organisation von Veranstaltungen wie beispielsweise Messen + - Performance-optimiertes ORM auf Basis von MongoDB und Redis + - Massen-Email-Versand in Hintergrundprozessen + +Technologien + - Python + - PHP, Yii-Framework + - MongoDB, Redis + - HTML 5, CSS3, jQuery, DataTables + +### 2008 - 2012 +#### Juristische Fakultät, Leibniz Universität Hannover +Administration, Webentwicklung und Druck-Layouting + +Technologien + - PHP + - Python + - LaTeX + - MySQL + +*** + # Markdown Test Page * [Headings](#Headings) @@ -132,24 +296,62 @@ Ad amet irure est magna id mollit Lorem in do duis enim. Excepteur velit nisi ma Et fugiat ad nisi amet magna labore do cillum fugiat occaecat cillum Lorem proident. In sint dolor ullamco ad do adipisicing amet id excepteur Lorem aliquip sit irure veniam laborum duis cillum. Aliqua occaecat minim cillum deserunt magna sunt laboris do do irure ea nostrud consequat ut voluptate ex. -```go -package main +### Bash -import ( - "fmt" - "net/http" -) +```bash +#!/bin/bash -func handler(w http.ResponseWriter, r *http.Request) { - fmt.Fprintf(w, "Hi there, I love %s!", r.URL.Path[1:]) +cd $ROOT_DIR +DOT_FILES="lastpass weechat ssh Xauthority" + +for dotfile in $DOT_FILES; do conform_link "$DATA_DIR/$dotfile" ".$dotfile"; done +``` + + +### C + +```c +#define UNICODE +#include + +int main(int argc, char **argv) { + int speed = 0, speed1 = 0, speed2 = 0; // 1-20 + + if (argc == 1) return 0; + if (argc >= 2) sscanf(argv[1], "%d", &speed1); + if (argc >= 3) sscanf(argv[2], "%d", &speed2); + + if (argc == 2) // set speed to first value + speed = speed1; + else if (speed == speed1 || speed == speed2) // alternate + speed = speed1 + speed2 - speed; + else + speed = speed1; // start with first value + + SystemParametersInfo(SPI_SETMOUSESPEED, 0, speed, 0); + SystemParametersInfo(SPI_GETMOUSESPEED, 0, &speed, 0); + printf("New speed: %2d\n", speed); + return 0; } +``` -func main() { - http.HandleFunc("/", handler) - http.ListenAndServe(":8080", nil) + +### CSS + +```css +/* CSS Comment */ +#some-id .some-class { + float: left; + width: 100px; } ``` +### HTML + +```html +Inline elements +``` + Ex amet id ex aliquip id do laborum excepteur exercitation elit sint commodo occaecat nostrud est. Nostrud pariatur esse veniam laborum non sint magna sit laboris minim in id. Aliqua pariatur pariatur excepteur adipisicing irure culpa consequat commodo et ex id ad. [[Top]](#top) From 7d4425831ff14d08ba67836f31bceda3f1eca3d1 Mon Sep 17 00:00:00 2001 From: Jens Kadenbach Date: Thu, 26 Sep 2019 09:48:14 +0200 Subject: [PATCH 5/6] Add a checkbox to disable the title --- schickmacher/renderer/forms.py | 5 +++++ schickmacher/renderer/tests/test_views.py | 20 +++++++++++++++++++ schickmacher/renderer/views.py | 1 + schickmacher/templates/renderer/rendered.html | 2 ++ 4 files changed, 28 insertions(+) diff --git a/schickmacher/renderer/forms.py b/schickmacher/renderer/forms.py index 4817a29..077259f 100644 --- a/schickmacher/renderer/forms.py +++ b/schickmacher/renderer/forms.py @@ -6,6 +6,7 @@ from markdownx.fields import MarkdownxFormField class RendererForm(forms.Form): title = forms.CharField(label=_('Title'), required=False) + show_title = forms.BooleanField(label=_('Show Title'), required=False) date = forms.DateField(label=_('Date'), initial=lambda: timezone.now().strftime('%Y-%m-%d'), widget=forms.TextInput( @@ -14,3 +15,7 @@ class RendererForm(forms.Form): render_content = MarkdownxFormField( label=_('Content'), ) + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.fields['show_title'].initial = True diff --git a/schickmacher/renderer/tests/test_views.py b/schickmacher/renderer/tests/test_views.py index 6860527..a07428e 100644 --- a/schickmacher/renderer/tests/test_views.py +++ b/schickmacher/renderer/tests/test_views.py @@ -24,3 +24,23 @@ class TestRendererFormView: assert b'Example' in response.content assert response.content.startswith(b'%PDF') + def test_html_render(self, client: Client): + response = client.post('/renderer/renderhtml', data={ + 'title': 'Sample Title', + 'date': '2009-11-15', + 'render_content': '# Example', + 'show_title': 'on', + }) + assert b'Sample Title' in response.content + assert b'

Sample Title

' in response.content + assert b'Example' in response.content + + def test_hiding_title(self, client: Client): + response = client.post('/renderer/renderhtml', data={ + 'title': 'Sample Title', + 'date': '2009-11-15', + 'render_content': '# Example' + }) + assert b'Sample Title' in response.content + assert b'

Sample Title

' not in response.content + assert b'Example' in response.content diff --git a/schickmacher/renderer/views.py b/schickmacher/renderer/views.py index b0b34ea..acf7154 100644 --- a/schickmacher/renderer/views.py +++ b/schickmacher/renderer/views.py @@ -21,6 +21,7 @@ class HtmlRenderView(TemplateView): if form.is_valid(): return { 'date': form.cleaned_data['date'], + 'show_title': form.cleaned_data['show_title'], 'content': markdownify(form.cleaned_data['render_content']), 'title': form.cleaned_data['title'] } diff --git a/schickmacher/templates/renderer/rendered.html b/schickmacher/templates/renderer/rendered.html index 29b7775..2ca154b 100644 --- a/schickmacher/templates/renderer/rendered.html +++ b/schickmacher/templates/renderer/rendered.html @@ -25,9 +25,11 @@
+ {% if show_title %}

{{ title }}

+ {% endif %}
{{ content | safe }}
From ae0eeafbfd55471d772788f23473576f9186648e Mon Sep 17 00:00:00 2001 From: jedi Date: Tue, 1 Oct 2019 12:57:31 +0200 Subject: [PATCH 6/6] splitview editor but quick and dirty --- schickmacher/static/sass/project.scss | 14 ++++++++++++-- schickmacher/templates/renderer/render_form.html | 2 -- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/schickmacher/static/sass/project.scss b/schickmacher/static/sass/project.scss index bf4ec76..787c6a5 100644 --- a/schickmacher/static/sass/project.scss +++ b/schickmacher/static/sass/project.scss @@ -3,7 +3,7 @@ // project specific CSS goes here //////////////////////////////// - //Variables// +//Variables// //////////////////////////////// // Alert colors @@ -16,7 +16,7 @@ $dark-pink: #eed3d7; $red: #b94a48; //////////////////////////////// - //Alerts// +//Alerts// //////////////////////////////// // bootstrap alert CSS, translated to the django-standard levels of @@ -34,6 +34,16 @@ $red: #b94a48; color: $red; } +.markdownx { + display: flex; + column-gap: 2.5em; +} + +.markdownx-editor { + width: 50%; +} + .markdownx-preview { + width: 50%; @import 'render'; } diff --git a/schickmacher/templates/renderer/render_form.html b/schickmacher/templates/renderer/render_form.html index f0db677..cb7e8b0 100644 --- a/schickmacher/templates/renderer/render_form.html +++ b/schickmacher/templates/renderer/render_form.html @@ -17,7 +17,5 @@ {% csrf_token %} {{ form|crispy }} -
{{ form.media }} -
{% endblock %}