Zenika-Training / zenika-formation-framework

Tools to build and present our training material
8 stars 25 forks source link

New theme! #215

Closed hgwood closed 6 years ago

hgwood commented 6 years ago

Closes #214. Screenshots incoming.

todo

hgwood commented 6 years ago

image

image

image

fabienjuif commented 6 years ago

Ca rend vraiment bien ;)

Il y a moyen d'ajouter une indentation pour les snippets de code ? Seulement quand c'est dans une liste à puce (je ne pense pas que ça ça soit possible) :)

hgwood commented 6 years ago

@fabienjuif en fait si ton code black est collé à ton bullet point en markdown alors le code block fera partie de la balise li et sera correctement indenté. Par contre, l'indentation du code à l'intérieur du bloc reste à absolue donc on se retrouve avec du code non indenté.

Exemple

- Par convention dans Node.js
  - Le premier argument correspond à une éventuelle erreur
  - Les autres arguments sont les données de l'évènement

``javascript
let callback = function(err, result) {
  if (err) {
    console.error(err.message);
  } else {
    console.log(result)
  }
};
``

image

- Par convention dans Node.js
  - Le premier argument correspond à une éventuelle erreur
  - Les autres arguments sont les données de l'évènement
``javascript
let callback = function(err, result) {
  if (err) {
    console.error(err.message);
  } else {
    console.log(result)
  }
};
``

image

Le problème n'est donc pas dans la conversion markdown->html ni dans le css du thème mais plutôt dans le plugin qui highlight le code.

olivierhuber commented 6 years ago

C'est top ! Je vois qu'il reste 3 todo donc on attend avant de merger ?

hgwood commented 6 years ago

Oui encore deux bugs importants.

olivierhuber commented 6 years ago

Plus que 1 issue ... Bravo ! Pensez vous que nos formations de la semaine prochaine pourrons en bénéficier ?

hgwood commented 6 years ago

@olivierhuber Not available myself until December 1st.

hgwood commented 6 years ago

I'm getting stuck on that last problem. But it is really important that it's fixed before applying the new theme. It's better to have the content properly printed in the old theme than to have it truncated in the new theme.

hgwood commented 6 years ago

Screenshots of the problem

Everything works fine when viewing the slides in the browser, even if print media is emulated.

image

But in the printing preview and the final PDF, the content is gone

image

hgwood commented 6 years ago

Works fine in Firefox. Might be a Chrome bug.

image

hgwood commented 6 years ago

Both Chrome stable 62.0.3202.94 and canary 64.0.3282.5 on Windows 10 reproduce the problem.

hgwood commented 6 years ago

Bug reproduced on Opera on macOS too.

hgwood commented 6 years ago

I might merge this but keep it behind some kind of flag or keyboard shortcut. The best would be to have the new theme for the HTML format (it works fine there) but leave the old theme for PDF generation. I'll try to do that.

hgwood commented 6 years ago

I'm still planning to do this! I should check if that bug is still present.

bpetetot commented 6 years ago

I made some tests on the ReactJS formation about the PDF rendering bug.

Some facts that I can't really explain :

before (blank slide):

image

after - adding blank lines between code (slide ok) :

image

hgwood commented 6 years ago

Dans la version que je viens de pousser, les deux thèmes sont dispos. L'ancien thème est par défaut, pour que les PDF se génèrent bien. On peut appuyer sur la touche 't' pour changer de thème.

Quand il sera temps de supprimer l'ancien thème, il faudra :

hgwood commented 6 years ago

@bpetetot pendant que tu es dans le bain tu voudrais bien me tester ça ?