-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(avent): add markdown support for 2019 articles #166
Conversation
src/Controller/AventController.php
Outdated
|
||
public function __construct(Environment $twig) | ||
{ | ||
$this->twig = $twig; | ||
if('prod' != getenv('APP_ENV')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
), | ||
2019 => array( | ||
'01-test' => 'Avent/2019/day_01.html.twig', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you should tell me how you want to split blocks with markdown only :)
{% apply markdown_to_html %} | ||
{% block article_content_md %}{% endblock %} | ||
{% endapply %} | ||
{% endif %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lol, ça ressemble à un hack x).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tellement, mais diviser en 3 fichiers pour faire la meme chose, ça apportait peu au final.
<p>bla bla</p> | ||
<p>bla bla</p> | ||
<p>bla bla</p> | ||
<p>bla bla</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
God, on avait vraiment ça en valeur par défaut? 😱
@@ -1,3 +0,0 @@ | |||
{% extends 'Avent/year.atom.twig' %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Y'avait un flux RSS? x)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Il est toujours là ❤️
Ce fichier servait juste à rien ...
{% block article_content_md %} | ||
|
||
--- | ||
__Advertisement :)__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pourquoi ce contenu ? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pour tester le md
75f29eb
to
26e983a
Compare
$this->futureEnabled = true; | ||
} | ||
else { | ||
$this->futureEnabled = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je pense que ça serait mieux de déplacer ça en config (parameter et/ou envvar), comme ça on évite de checker dans quel environnement on est dans le code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C'est une feature de debug, pour moi pas besoin de variabiliser ça, l'environnement porte déjà le fait de l'activer ou non
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# config/services.yaml
parameters:
enable_future: false
# config/services_dev.yaml
enable_future: true
Et tu fais un binding avec ce paramètre.
Pas besoin de var d'env :)
On a déjà un bundle pour transformer du markdown en HTML : https://github.com/KnpLabs/KnpMarkdownBundle, qui est déjà utilisée pour les Il embarque une extension Twig qui devrait pouvoir être utilisée pour l'avent, donc a priori pas besoin d'ajouter une autre lib :) |
Je suis plus d'avis d'utiliser l'extension officielle, compatible twig 3 et maintenue :) |
26e983a
to
f283660
Compare
Ca m'embête un peu qu'on garde les deux, ça fait redondant non ? 😕 Ta lib fonctionne parce qu'un parser est déjà installé depuis l'autre bundle, d'ailleurs 😛 |
J'ai rajouté la dépendance manquante. Imo, le mieux c'est d'avoir les articles sur l'extension officielle et dans une autre PR, enlever le bundle Knp. La logique de stockage des articles est un peu old school et mériterait une petite refacto dédiée. |
Ok pour moi, on verra pour harmoniser tout ça 💪 |
@nayluge tu peux rebase stp? :) |
fd9a009
to
c94ef2b
Compare
@Nek- : done |
No description provided.