feat(viewer): #90 toolbar groupes aussi pour les fichiers texte non markdown
CI / lint (push) Successful in 1m18s
CI / security (push) Successful in 53s
CI / test (push) Successful in 2m30s
CI / build (push) Successful in 50s
CI / e2e (push) Successful in 10m27s

[pop-out][Bookmark] | [Editer][Source][.ext][Pretty] | [Copier] | [Partager]
- TOC ancre uniquement au markdown (plus de bouton TOC sur .sh/.py/...)
- PDF/Export deja ancres au markdown: groupe export = [Copier] seul sur texte
- tests toolbar-order mis a jour (conditions is_markdown sur nav/export)
This commit is contained in:
2026-09-15 08:24:22 -04:00
parent 14b99826eb
commit 140a8f6efe
4 changed files with 31 additions and 17 deletions
+8 -4
View File
@@ -882,10 +882,14 @@ export function renderFile(data) {
// Separateur visuel entre les groupes d'actions (#90)
const actionSep = () => el("span", { class: "action-sep" });
// Ordre des boutons par groupes fonctionnels (#90) :
// [TOC][pop-out][Bookmark] | [Editer][Source][.md][Forge] | [Copier][PDF][Export] | [Partager]
// Boutons non affiches selon le type de fichier (Pretty, PDF/Export hors
// markdown, ...) restent ancres a leur groupe ; spacer de groupe vide retire.
const navBtns = [tocBtn, openNewWindowBtn, bookmarkBtn];
// markdown : [TOC][pop-out][Bookmark] | [Editer][Source][.md][Forge] | [Copier][PDF][Export] | [Partager]
// texte autre : [pop-out][Bookmark] | [Editer][Source][.ext][Pretty] | [Copier] | [Partager]
// Boutons non applicables au type de fichier (TOC hors markdown, Pretty hors
// texte, PDF/Export hors markdown, ...) restent ancres a leur groupe ;
// spacer de groupe vide retire.
const navBtns = [];
if (data.is_markdown) navBtns.push(tocBtn);
navBtns.push(openNewWindowBtn, bookmarkBtn);
const editBtns = [];
if (!data.unsupported) editBtns.push(editBtn);
editBtns.push(sourceBtn);