deviantfero / wpgtk

:flower_playing_cards: a colorscheme, wallpaper and template manager for *nix
http://deviantfero.github.io/wpgtk/
GNU General Public License v2.0
2.05k stars 49 forks source link

template doesn't work on some cases of .json file i guess..? #276

Closed beats-beats closed 1 year ago

beats-beats commented 1 year ago

hi i'm trying to make a template for glow theme.json

testing: {color0}
{
  "document": {
    "block_prefix": "\n",
    "block_suffix": "\n",
    "color": "#f8f8f2",
    "margin": 2
  },...
.................
.................
.................

here's the original file:

{
  "document": {
    "block_prefix": "\n",
    "block_suffix": "\n",
    "color": "#f8f8f2",
    "margin": 2
  },
  "block_quote": {
    "color": "#f1fa8c",
    "italic": true,
    "indent": 2
  },
  "paragraph": {},
  "list": {
    "color": "#f8f8f2",
    "level_indent": 2
  },
  "heading": {
    "block_suffix": "\n",
    "color": "#bd93f9",
    "bold": true
  },
  "h1": {
    "prefix": "# "
  },
  "h2": {
    "prefix": "## "
  },
  "h3": {
    "prefix": "### "
  },
  "h4": {
    "prefix": "#### "
  },
  "h5": {
    "prefix": "##### "
  },
  "h6": {
    "prefix": "###### "
  },
  "text": {},
  "strikethrough": {
    "crossed_out": true
  },
  "emph": {
    "color": "#f1fa8c",
    "italic": true
  },
  "strong": {
    "color": "#ffb86c",
    "bold": true
  },
  "hr": {
    "color": "#6272A4",
    "format": "\n--------\n"
  },
  "item": {
    "block_prefix": "• "
  },
  "enumeration": {
    "block_prefix": ". ",
    "color": "#8be9fd"
  },
  "task": {
    "ticked": "[✓] ",
    "unticked": "[ ] "
  },
  "link": {
    "color": "#8be9fd",
    "underline": true
  },
  "link_text": {
    "color": "#ff79c6"
  },
  "image": {
    "color": "#8be9fd",
    "underline": true
  },
  "image_text": {
    "color": "#ff79c6",
    "format": "Image: {{.text}} →"
  },
  "code": {
    "color": "#50fa7b"
  },
  "code_block": {
    "color": "#ffb86c",
    "margin": 2,
    "chroma": {
      "text": {
        "color": "#f8f8f2"
      },
      "error": {
        "color": "#f8f8f2",
        "background_color": "#ff5555"
      },
      "comment": {
        "color": "#6272A4"
      },
      "comment_preproc": {
        "color": "#ff79c6"
      },
      "keyword": {
        "color": "#ff79c6"
      },
      "keyword_reserved": {
        "color": "#ff79c6"
      },
      "keyword_namespace": {
        "color": "#ff79c6"
      },
      "keyword_type": {
        "color": "#8be9fd"
      },
      "operator": {
        "color": "#ff79c6"
      },
      "punctuation": {
        "color": "#f8f8f2"
      },
      "name": {
        "color": "#8be9fd"
      },
      "name_builtin": {
        "color": "#8be9fd"
      },
      "name_tag": {
        "color": "#ff79c6"
      },
      "name_attribute": {
        "color": "#50fa7b"
      },
      "name_class": {
        "color": "#8be9fd"
      },
      "name_constant": {
        "color": "#bd93f9"
      },
      "name_decorator": {
        "color": "#50fa7b"
      },
      "name_exception": {},
      "name_function": {
        "color": "#50fa7b"
      },
      "name_other": {},
      "literal": {},
      "literal_number": {
        "color": "#6EEFC0"
      },
      "literal_date": {},
      "literal_string": {
        "color": "#f1fa8c"
      },
      "literal_string_escape": {
        "color": "#ff79c6"
      },
      "generic_deleted": {
        "color": "#ff5555"
      },
      "generic_emph": {
        "color": "#f1fa8c",
        "italic": true
      },
      "generic_inserted": {
        "color": "#50fa7b"
      },
      "generic_strong": {
        "color": "#ffb86c",
        "bold": true
      },
      "generic_subheading": {
        "color": "#bd93f9"
      },
      "background": {
        "background_color": "#282a36"
      }
    }
  },
  "table": {
    "center_separator": "┼",
    "column_separator": "│",
    "row_separator": "─"
  },
  "definition_list": {},
  "definition_term": {},
  "definition_description": {
    "block_prefix": "\n🠶 "
  },
  "html_block": {},
  "html_span": {}
}

but nothing changes when I reload wpg it only work when I make the follow changes to the .base template file

testing: {color0}
// removed all lines from here

results:

testing: #654654
// removed all lines from here

No idea why the original file doesn't update image image

kleshas commented 1 year ago

You have to replace all {...} with {{...}} in the .base so wpg removes one of the {} pairs, thereby leaving a single {} pair in the actual config file. edit: wpg -m at terminal can give useful errors. Also, when a change of theme errors, the file that is templated doesn't update, which can make it difficult to troubleshoot.

deviantfero commented 1 year ago

Yes, this is covered in the templates section of the wiki

On Mon, Mar 6, 2023, 1:18 PM kleshas @.***> wrote:

You have to replace all {...} with {{...}} in the .base so wpg removes one of the {} pairs, thereby leaving a single {} pair in the actual config file.

— Reply to this email directly, view it on GitHub https://github.com/deviantfero/wpgtk/issues/276#issuecomment-1455422164, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACVCGSMFUEWVPVXSG573GOLW2VQSPANCNFSM6AAAAAAVPISANU . You are receiving this because you are subscribed to this thread.Message ID: @.***>