summaryrefslogtreecommitdiff
path: root/site/ox-html-uswds-components.el
diff options
context:
space:
mode:
Diffstat (limited to 'site/ox-html-uswds-components.el')
-rw-r--r--site/ox-html-uswds-components.el148
1 files changed, 148 insertions, 0 deletions
diff --git a/site/ox-html-uswds-components.el b/site/ox-html-uswds-components.el
new file mode 100644
index 0000000..08e9684
--- /dev/null
+++ b/site/ox-html-uswds-components.el
@@ -0,0 +1,148 @@
+;;; ox-html-uswds-components.el --- Transcription functions for all USWDS components, -*- lexical-binding: t; -*-
+;; Copyright (C) 2021 Marius Peter
+
+;; Author: Marius Peter (rot13 "?znevhf.crgre@ghgnabgn.pbz")
+;; Created: March 2021
+;; Package-Version: 0.1
+;; Keywords: org export publish html
+;; Homepage: http://www.smart-documents.org
+
+;; This file is not part of GNU Emacs.
+
+;;; License:
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+;;
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with this file. If not, see <http://www.gnu.org/licenses/>.
+;;; Commentary:
+
+;; These are all the components made available by the USDWS.
+
+;;; Code:
+
+(defun uswds-component-accordion (contents)
+ (format "<script>%s</script>" contents))
+
+(defun uswds-component-alert-info (contents)
+ (format "<div class=\"usa-alert usa-alert--info\" >
+ <div class=\"usa-alert__body\">
+ <h3 class=\"usa-alert__heading\">Informative status</h3>
+ <p class=\"usa-alert__text\">%s</p>
+ </div>
+</div>" contents))
+
+(defun uswds-component-alert-warning (contents)
+ (format "<div class=\"usa-alert usa-alert--warning\" >
+ <div class=\"usa-alert__body\">
+ <h3 class=\"usa-alert__heading\">Warning status</h3>
+ <p class=\"usa-alert__text\">%s</p>
+ </div>
+</div>" contents))
+
+(defun uswds-component-alert-error (contents)
+ (format "<div class=\"usa-alert usa-alert--error\" >
+ <div class=\"usa-alert__body\">
+ <h3 class=\"usa-alert__heading\">Error status</h3>
+ <p class=\"usa-alert__text\">%s</p>
+ </div>
+</div>" contents))
+
+(defun uswds-component-alert-success (contents)
+ (format "<div class=\"usa-alert usa-alert--success\" >
+ <div class=\"usa-alert__body\">
+ <h3 class=\"usa-alert__heading\">Success status</h3>
+ <p class=\"usa-alert__text\">%s</p>
+ </div>
+</div>" contents))
+
+(defun uswds-component-alert-slim (contents)
+ (format "<div class=\"usa-alert usa-alert--slim\" >
+ <div class=\"usa-alert__body\">
+ <p class=\"usa-alert__text\">%s</p>
+ </div>
+</div>" contents))
+
+(defun uswds-component-alert-no-icon (contents)
+ (format "<div class=\"usa-alert usa-alert--no-icon\" >
+ <div class=\"usa-alert__body\">
+ <p class=\"usa-alert__text\">%s</p>
+ </div>
+</div>" contents))
+
+(defun uswds-component-banner (contents)
+ (format "<style type=\"text/css\">%s</style>" contents))
+
+(defun uswds-component-breadcrumb (contents)
+ (format "<style type=\"text/css\">%s</style>" contents))
+
+(defun uswds-component-button (contents)
+ ;; <a class=\"usa-button\" href=\"https://github.com/Blendoit/.emacs.d\">%s</a>
+ (format "<a class=\"usa-button\">%s</a>" contents))
+
+(defun uswds-component-button-group (contents)
+ (format "<style type=\"text/css\">%s</style>" contents))
+
+(defun uswds-component-card (contents)
+ (format "<style type=\"text/css\">%s</style>" contents))
+
+(defun uswds-component-collection (contents)
+ (format "<style type=\"text/css\">%s</style>" contents))
+
+(defun uswds-component-footer (contents)
+ (format "<style type=\"text/css\">%s</style>" contents))
+
+;; TODO form controls and templates
+(defun uswds-component-grid (contents)
+ (format "<style type=\"text/css\">%s</style>" contents))
+
+(defun uswds-component-header (contents)
+ (format "<style type=\"text/css\">%s</style>" contents))
+
+;; TODO icons
+
+(defun uswds-component-identifier (contents)
+ (format "<style type=\"text/css\">%s</style>" contents))
+
+(defun uswds-component-process (contents)
+ (format "<style type=\"text/css\">%s</style>" contents))
+
+(defun uswds-component-search (contents)
+ (format "<style type=\"text/css\">%s</style>" contents))
+
+(defun uswds-component-side (contents)
+ (format "<style type=\"text/css\">%s</style>" contents))
+
+(defun uswds-component-site (contents)
+ (format "<style type=\"text/css\">%s</style>" contents))
+
+(defun uswds-component-step (contents)
+ (format "<style type=\"text/css\">%s</style>" contents))
+
+(defun uswds-component-summary (contents)
+ (format "<style type=\"text/css\">%s</style>" contents))
+
+;; TODO table?
+
+(defun uswds-component-tag (contents)
+ (format "<span class=\"usa-tag\">%s</span>" contents))
+
+(defun uswds-component-tooltip (contents)
+ (format "<style type=\"text/css\">%s</style>" contents))
+
+(defun uswds-component-tooltip (contents)
+ (format "<style type=\"text/css\">%s</style>" contents))
+
+(defun uswds-component-tooltip (contents)
+ (format "<style type=\"text/css\">%s</style>" contents))
+
+(provide 'ox-html-uswds-components)
+;;; ox-html-uswds-components.el ends here
+
Copyright 2019--2024 Marius PETER