<commit_before>;;; lang/web/config.el -*- lexical-binding: t; -*-

(load! +html)
(load! +css)


(def-package! web-beautify
  :commands (web-beautify-html web-beautify-css)
  :init
  (map! (:map* (css-mode-map scss-mode-map less-css-mode-map)
          :n "gQ" #'web-beautify-css)
        (:map* web-mode-map
          :n "gQ" #'web-beautify-html)))


(def-package! emmet-mode
  :commands emmet-mode
  :preface (defvar emmet-mode-keymap (make-sparse-keymap))
  :init
  (add-hook! (css-mode web-mode html-mode haml-mode nxml-mode rjsx-mode)
    'emmet-mode)
  :config
  (setq emmet-move-cursor-between-quotes t)
  (map! :map emmet-mode-keymap
        :v "M-e" #'emmet-wrap-with-markup
        :i "M-e" #'emmet-expand-yas
        :i "M-E" #'emmet-expand-line))


;;
;; Frameworks
;;

(def-project-mode! +web-angularjs-mode
  :modes (+javascript-npm-mode)
  :when (+javascript-npm-dep-p 'angular))

(def-project-mode! +web-jekyll-mode
  :modes (web-mode js-mode coffee-mode css-mode haml-mode pug-mode)
  :files (and "config.yml" (or "_layouts/" "_posts/"))
  :init
  (defun +web|init-jekyll-mode ()
    (when (eq major-mode 'web-mode)
      (web-mode-set-engine "django")))
  (add-hook '+web-jekyll-mode-hook #'+web|init-jekyll-mode))

(def-project-mode! +web-wordpress-mode
  :modes (php-mode web-mode css-mode haml-mode pug-mode)
  :files (or "wp-config.php" "wp-config-sample.php"))

(def-project-mode! +web-react-mode
  :modes (+javascript-npm-mode)
  :when (+javascript-npm-dep-p 'react))

(def-project-mode! +web-phaser-mode
  :modes (+javascript-npm-mode)
  :when (+javascript-npm-dep-p '(or phaser phaser-ce)))<commit_msg>lang/web: refactor +web-jekyll-mode<commit_after>;;; lang/web/config.el -*- lexical-binding: t; -*-

(load! +html)
(load! +css)


(def-package! web-beautify
  :commands (web-beautify-html web-beautify-css)
  :init
  (map! (:map* (css-mode-map scss-mode-map less-css-mode-map)
          :n "gQ" #'web-beautify-css)
        (:map* web-mode-map
          :n "gQ" #'web-beautify-html)))


(def-package! emmet-mode
  :commands emmet-mode
  :preface (defvar emmet-mode-keymap (make-sparse-keymap))
  :init
  (add-hook! (css-mode web-mode html-mode haml-mode nxml-mode rjsx-mode)
    'emmet-mode)
  :config
  (setq emmet-move-cursor-between-quotes t)
  (map! :map emmet-mode-keymap
        :v "M-e" #'emmet-wrap-with-markup
        :i "M-e" #'emmet-expand-yas
        :i "M-E" #'emmet-expand-line))


;;
;; Frameworks
;;

(def-project-mode! +web-angularjs-mode
  :modes (+javascript-npm-mode)
  :when (+javascript-npm-dep-p 'angular))

(def-project-mode! +web-jekyll-mode
  :modes (web-mode js-mode coffee-mode css-mode haml-mode pug-mode)
  :files (and "config.yml" (or "_layouts/" "_posts/"))
  :on-enter
  (when (eq major-mode 'web-mode)
    (web-mode-set-engine "django")))

(def-project-mode! +web-wordpress-mode
  :modes (php-mode web-mode css-mode haml-mode pug-mode)
  :files (or "wp-config.php" "wp-config-sample.php"))

(def-project-mode! +web-react-mode
  :modes (+javascript-npm-mode)
  :when (+javascript-npm-dep-p 'react))

(def-project-mode! +web-phaser-mode
  :modes (+javascript-npm-mode)
  :when (+javascript-npm-dep-p '(or phaser phaser-ce)))
{'fraction_non_alphanumeric': 0.19302106255894372, 'fraction_numerical': 0.0, 'mean_word_length': 3.294197031039136, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '486875', 'n_tokens_mistral': 1349, 'n_tokens_neox': 1311, 'n_words': 242}