mirror of https://github.com/onweru/compose.git

weru
19.08.2023 e106caa15d62518fcf6d79354f08407863ad42e4
highlight terminal commands

Signed-off-by: weru <fromweru@gmail.com>
2 files modified
25 ■■■■ changed files
assets/js/code.js 14 ●●●● patch | view | raw | blame | history
assets/sass/_syntax.sass 11 ●●●●● patch | view | raw | blame | history
assets/js/code.js
@@ -271,10 +271,20 @@
  });
  (function addLangLabel() {
    const shell_based = ['sh', 'shell', 'zsh', 'bash'];
    const blocks = codeBlocks();
    blocks.forEach(function(block){
    blocks.forEach(block => {
      let label = block.dataset.lang;
      label = label === 'sh' ? 'bash' : label;
      const is_shell_based = shell_based.includes(label);
      if(is_shell_based) {
        const lines = elems(lineClass, block);
        Array.from(lines).forEach(line => {
          pushClass(line, 'shell');
        });
      }
      label = label === 'sh' ? 'shell' : label;
      if(label !== "fallback") {
        const labelEl = createEl();
        labelEl.textContent = label;
assets/sass/_syntax.sass
@@ -232,4 +232,13 @@
    letter-spacing: 0.1px
    z-index: 19
  &_expanded &_from
    display: none
    display: none
.shell
  position: relative
  display: flex
  align-items: center
  gap: 0.5rem
  &::before
    content: "$"
    position: relative