Skip to content

Commit

Permalink
Docs: (defpred.org) Add HTML export
Browse files Browse the repository at this point in the history
It looks nice, even if it isn't practically viewable on GitHub.
  • Loading branch information
alphapapa committed Nov 23, 2020
1 parent b01106b commit 92d099c
Show file tree
Hide file tree
Showing 25 changed files with 2,257 additions and 2 deletions.
766 changes: 766 additions & 0 deletions examples/defpred.html

Large diffs are not rendered by default.

13 changes: 11 additions & 2 deletions examples/defpred.org
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#+TITLE: Org QL Custom Predicates Tutorial
#+OPTIONS: author:nil creator:nil created:nil date:nil num:nil title:t
#+OPTIONS: author:nil creator:nil created:nil date:nil num:nil title:t broken-links:t
#+SETUPFILE: export/setup/theme-darksun-local.setup

[2020-11-22 Sun 22:35] Imagine you have weekly meetings with other people, and during the week you take notes about items to discuss at each meeting. When the time for a meeting comes, you want to quickly and easily search for all of the items to discuss at the meeting.

You've been experimenting with different ways to track such data in Org. You've tried using tags, but some of the names in question conflict with other tags in your data (e.g. someone's named Charles, but you also work with a firm named Charles, Inc., and you'd prefer to continue using the tag =Charles= for entries about that firm), so you've been using tags like ~:personNAME:~, which seems awkward. You've tried using a ~:person: NAME~ property on entries, which has the advantage of not cluttering the tags list, but also the disadvantage of not being readily visible in an outline.

So you haven't decided on a long-term solution, but the meetings aren't going to wait--you need to search that data now, and you have a mix of both tags and properties in your entries. What you need is to be able to search for all of the entries about Alice (which you've tagged ~:personAlice:~) when you're meeting with her, and all of the entries about Bob (which have the property ~:person: Bob~) when you're meeting with him. What do you do?

* Contents
* Contents :noexport:
:PROPERTIES:
:TOC: :include siblings :ignore this
:END:
Expand Down Expand Up @@ -130,6 +131,8 @@ And that works fine. But it seems like a lot to type. Could we make the =perso
(tags (concat "person" name)))))
#+END_SRC

Now let's search again:

#+BEGIN_SRC elisp :results list :exports both :cache yes
(org-ql-query :select '(org-get-heading :no-tags)
:from (current-buffer)
Expand Down Expand Up @@ -243,6 +246,8 @@ No problem, let's just select high-priority items:
(org-ql-search (current-buffer) "person:Alice,Bob priority:A")
#+END_SRC

Which shows:

#+BEGIN_EXAMPLE
Query: (and (person "Alice" "Bob") (priority "A")) In:meetings.org
[#A] Loud pet parakeet :personAlice:
Expand All @@ -266,10 +271,14 @@ And, you know what, if you're just so busy that you don't even have time to type
(tags (concat "person" name)))))
#+END_SRC

Let's try it:

#+BEGIN_SRC elisp :results silent :exports code
(org-ql-search (current-buffer) "p:Alice,Bob priority:A")
#+END_SRC

And that shows:

#+BEGIN_EXAMPLE
Query: (and (person "Alice" "Bob") (priority "A")) In:meetings.org
[#A] Loud pet parakeet :personAlice:
Expand Down
17 changes: 17 additions & 0 deletions examples/export/setup/theme-darksun-local.setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# -*- mode: org; -*-

# The files that hide sections and display a navbar and ToC are commented out.

# #+HTML_HEAD: <link rel="stylesheet" type="text/css" href="export/styles/darksun/css/htmlize.css"/>
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="export/styles/darksun/css/darksun.css"/>
# #+HTML_HEAD: <link rel="stylesheet" type="text/css" href="export/styles/darksun/css/hideshow.css"/>

#+HTML_HEAD: <script type="text/javascript" src="export/styles/darksun/js/jquery-1.11.0.min.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="export/styles/darksun/js/jquery-ui-1.10.2.min.js"></script>

#+HTML_HEAD: <script type="text/javascript" src="export/styles/darksun/js/jquery.localscroll-min.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="export/styles/darksun/js/jquery.scrollTo-1.4.3.1-min.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="export/styles/darksun/js/jquery.zclip.min.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="export/styles/darksun/js/darksun.js"></script>
# #+HTML_HEAD: <script type="text/javascript" src="export/styles/darksun/js/hideshow.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="export/styles/lib/js/jquery.stickytableheaders.min.js"></script>
15 changes: 15 additions & 0 deletions examples/export/setup/theme-darksun.setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# -*- mode: org; -*-

#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="http://www.pirilampo.org/styles/darksun/css/htmlize.css"/>
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="http://www.pirilampo.org/styles/darksun/css/darksun.css"/>
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="http://www.pirilampo.org/styles/darksun/css/hideshow.css"/>

#+HTML_HEAD: <script type="text/javascript" src="http://www.pirilampo.org/styles/darksun/js/jquery-1.11.0.min.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="http://www.pirilampo.org/styles/darksun/js/jquery-ui-1.10.2.min.js"></script>

#+HTML_HEAD: <script type="text/javascript" src="http://www.pirilampo.org/styles/darksun/js/jquery.localscroll-min.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="http://www.pirilampo.org/styles/darksun/js/jquery.scrollTo-1.4.3.1-min.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="http://www.pirilampo.org/styles/darksun/js/jquery.zclip.min.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="http://www.pirilampo.org/styles/darksun/js/darksun.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="http://www.pirilampo.org/styles/darksun/js/hideshow.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="http://www.pirilampo.org/styles/lib/js/jquery.stickytableheaders.min.js"></script>
264 changes: 264 additions & 0 deletions examples/export/styles/darksun/css/darksun.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
* {
border-color: #657b83;
}
a {
color: #268bd2 !important;
}
a:visited {
color: #6c71c4 !important;
}
body {
background-color: #002b36 !important;
color: #839496 !important;
font-family: Libre Baskerville, serif;
}
html {
background-color: #002b36 !important;
}
input,
textarea {
background-color: #073642 !important;
color: #839496 !important;
}
blockquote,
code,
pre {
background-color: #073642 !important;
border: 1px solid #094352 !important;
border-radius: 2px;
box-shadow: none;
color: #839496 !important;
}
code {
font-size: 1.2em;
}
img {
margin: 0.5em;
}
.buttons {
background-color: #073642 !important;
color: #93a1a1 !important;
font-family: sans-serif;
font-size: 1.5rem;
}
.hsReviewPanel {
display: none;
}
.title {
border: 0;
}
#postamble {
display: none;
}
#banner {
text-align: center;
}
#tabs {
background-color: #073642 !important;
float: left;
margin: 0px 0px 20px 0px;
padding: 0;
width: 100%;
font-family: sans-serif;
}
#tabs ul {
margin: 0;
padding: 0;
}
#tabs li {
float: left;
list-style-type: none;
margin: 0px 2px 0px 0px;
padding: 0px 0px 0px 0px;
white-space: nowrap;
}
#tabs li a {
display: block;
font-size: 120%;
font-weight: bold;
margin: 0;
padding: 4px 10px 4px 10px;
text-decoration: none;
}
#tabs li a:hover {
color: #90c5eb !important;
}
#tabs li.ui-tabs-active a {
background-color: #094352 !important;
color: #59a9e1 !important;
}
#content {
clear: both;
width: 80%;
}
#content > p {
margin: 1em;
}
#content > div > h2 {
margin: 0.25rem;
}
#postamble {
text-align: right;
}
blockquote {
background-color: #073642 !important;
padding-left: 0.75em;
padding-right: 0.75em;
padding-top: 0.01em;
padding-bottom: 0.01em;
overflow: hidden;
margin-left: 0;
}
.outline-text-2,
.outline-text-3,
.outline-text-4,
.outline-text-5,
.outline-text-6 {
padding-left: 4%;
}
.outline-3 {
padding-left: 4%;
}
.outline-4 {
padding-left: 4%;
}
.outline-5 {
padding-left: 4%;
}
.outline-6 {
padding-left: 4%;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: sans-serif;
border-bottom: 2px solid;
border-color: #094352 !important;
}
a:hover {
text-decoration: underline;
}
#search {
display: block;
float: right;
}
.tag {
background-color: #002b36 !important;
color: #93a1a1 !important;
border: 0px;
}
.tag span {
background-color: #094352 !important;
margin: 0.25em;
padding: 0.25em;
}
#table-of-contents {
display: table;
float: right;
}
#table-of-contents h2 {
display: none;
}
#table-of-contents li {
list-style-type: none;
}
#table-of-contents a:hover {
text-decoration: underline;
}
#minitoc {
background-color: #073642 !important;
position: fixed;
top: 0px;
right: -5px;
padding: 0.5em;
z-index: 200;
width: 18%;
word-wrap: normal;
overflow: hidden;
}
#minitoc ul {
margin: 0.5em;
padding-left: 1em;
}
#minitoc h2 {
margin-top: 0;
margin-bottom: 0;
font-size: 110%;
}
#minitoc a {
display: block;
font-family: sans-serif;
text-decoration: none;
}
#minitoc a:hover {
text-decoration: underline;
}
/* #minitoc a { */
/* display: none; */
/* } */
#minitoc:hover a {
display: block;
}
#toTop {
top: -100px;
position: fixed;
text-align: center;
z-index: 999;
display: none;
}
#toTop:hover {
text-decoration: underline;
}
#left-panel-wrapper {
display: none;
position: fixed;
z-index: 200;
}
#left-panel-contents {
display: none;
position: fixed;
text-align: left;
top: 0;
z-index: 200;
}
#left-panel-button {
transform: rotate(90deg);
left: -23px;
position: fixed;
top: 50%;
z-index: 200;
}
#right-panel-wrapper {
position: fixed;
z-index: 200;
}
#right-panel-contents {
display: none;
z-index: 200;
position: fixed;
text-align: left;
top: 0;
}
.snippet-copy-to-clipboard {
display: none;
position: absolute;
left: 50px;
top: 50px;
}
.org-ol > li,
.org-dl > dt {
margin-top: 0.5em;
}
.org-ul {
margin-top: 1em;
margin-bottom: 1em;
}
.org-ul li {
margin-top: 0.5em;
}
.org-ul > li > a {
font-family: sans-serif;
}
Loading

0 comments on commit 92d099c

Please sign in to comment.