Subversion Repositories KB4IT

Compare Revisions

Ignore whitespace Rev 135 → Rev 136

/branches/BR-0.6-uikit/kb4it/resources/online/css/fontawesome-4.7.0.css
File deleted
/branches/BR-0.6-uikit/kb4it/resources/online/css/print.css
File deleted
/branches/BR-0.6-uikit/kb4it/resources/online/css/kb4it.css
File deleted
/branches/BR-0.6-uikit/kb4it/resources/online/css/coderay-asciidoctor.css
File deleted
/branches/BR-0.6-uikit/kb4it/resources/offline/templates/DOC_CARD.tpl
1,5 → 1,5
<!-- Docuemnt card :: START -->
<div class="uk-card uk-border-rounded uk-card-small uk-card-hover uk-auto@m" uk-scrollspy="target: > div; cls: uk-animation-fade; delay: 200">
<div class="uk-card uk-border-rounded uk-card-small uk-card-hover uk-auto@m" uk-scrollspy="target: > div; cls: uk-animation-fade; delay: 100">
<div class="uk-card-header">
<div class="uk-grid-small uk-flex-middle" uk-grid>
<!--
/branches/BR-0.6-uikit/kb4it/resources/offline/templates/INDEX.tpl
29,7 → 29,7
<a class="uk-accordion-title" href="#">Core properties</a>
<div class="uk-accordion-content">
<!-- Modal buttons for keys :: START-->
<div class="uk-card uk-border-rounded uk-card-small uk-auto@m uk-background-muted" uk-scrollspy="target: > div; cls: uk-animation-fade; delay: 200">
<div class="uk-card uk-border-rounded uk-card-small uk-auto@m uk-background-muted" style="border: 1px solid gray;">
<div class="uk-card-header">
<div class="uk-grid-medium uk-flex-middle uk-child-width-expand" uk-grid>
<div class="uk-width-expand">
47,7 → 47,7
<a class="uk-accordion-title" href="#">Custom properties</a>
<div class="uk-accordion-content">
<!-- Modal buttons for keys :: START-->
<div class="uk-card uk-border-rounded uk-card-small uk-auto@m uk-background-muted" uk-scrollspy="target: > div; cls: uk-animation-fade; delay: 200">
<div class="uk-card uk-border-rounded uk-card-small uk-auto@m uk-background-muted">
<div class="uk-card-header">
<div class="uk-grid-medium uk-flex-middle" uk-grid>
<div class="uk-width-expand">
65,7 → 65,7
<a class="uk-accordion-title" href="#">Stats</a>
<div class="uk-accordion-content">
<!-- Stats :: START-->
<div class="uk-card uk-border-rounded uk-card-small uk-auto@m uk-background-muted" uk-scrollspy="target: > div; cls: uk-animation-fade; delay: 200">
<div class="uk-card uk-border-rounded uk-card-small uk-auto@m uk-background-muted">
<div class="uk-card-header">
<div class="uk-grid-medium uk-flex-middle" uk-grid>
<div class="uk-width-expand">
/branches/BR-0.6-uikit/kb4it/resources/offline/templates/KEY_MODAL_BUTTON.tpl
1,7 → 1,7
<div> <!-- Button :: START -->
<div class="uk-card uk-border-rounded uk-card-hover uk-card-body uk-padding-remove-horizontal">
<a class="uk-button uk-button-muted uk-text-capitalize uk-text-large" href="#modal-full-%s" uk-toggle>%s</a>
<div id="modal-full-%s" class="uk-modal-container" uk-scrollspy="target: > div; cls: uk-animation-fade; delay: 200" uk-modal>
<div class="uk-card uk-border-rounded uk-card-hover uk-card-body uk-padding-remove">
<a class="uk-button uk-button-muted uk-card-body uk-text-capitalize" href="#modal-full-%s" uk-toggle><h5>%s</h5></a>
<div id="modal-full-%s" class="uk-modal-container" uk-modal>
<div class="uk-modal-dialog" uk-overflow-auto>
<button class="uk-modal-close-full uk-close-large uk-light uk-background-secondary" type="button" uk-close></button>
<div class="uk-modal-header uk-light uk-background-secondary">
/branches/BR-0.6-uikit/kb4it/resources/offline/templates/WORDCLOUD.tpl
0,0 → 1,3
<div uk-grid="parallax: 150">
%s
</div>
/branches/BR-0.6-uikit/kb4it/resources/offline/templates/WORDCLOUD_ITEM.tpl
0,0 → 1,3
<div class="uk-container-xsmall">
<a class="uk-link-heading" style="text-decoration: none;" href="%s"><span style="font-size:%dpt;">%s</span></a>
</div>
/branches/BR-0.6-uikit/kb4it/resources/online/uikit/css/print.css
37,4 → 37,8
font: 13px Arial, Helvetica,"Lucida Grande", serif;
color: #000;
}
 
.noprint {
display: none ;
}
}
/branches/BR-0.6-uikit/kb4it/src/core/mod_env.py
51,7 → 51,7
 
# Local paths
LPATH = {}
LPATH['ROOT'] = os.path.join(USER_DIR, '.', APP['shortname'].lower())
LPATH['ROOT'] = os.path.join(USER_DIR, ".%s" % APP['shortname'].lower())
LPATH['ETC'] = os.path.join(LPATH['ROOT'], 'etc')
LPATH['VAR'] = os.path.join(LPATH['ROOT'], 'var')
LPATH['DB'] = os.path.join(LPATH['VAR'], 'db')
/branches/BR-0.6-uikit/kb4it/src/core/mod_trans.py
34,10 → 34,10
TABLE_OLD = """<table class="tableblock frame-all grid-all stretch">"""
TABLE_NEW = """<table class="uk-table uk-table-divider uk-table-striped uk-table-hover uk-table-small">"""
METADATA_OLD = """<div class="uk-margin-small-bottom uk-card uk-card-body uk-card-hover uk-border-rounded">"""
METADATA_NEW = """<div id="kb4it-doc-metadata" class="uk-margin-small-bottom uk-card uk-card-body uk-card-hover uk-border-rounded uk-background-muted" style="border: 1px solid black;">"""
METADATA_NEW = """<div id="kb4it-doc-metadata" class="uk-margin-small-bottom uk-card uk-card-body uk-card-hover uk-border-rounded uk-background-muted noprint" style="border: 1px solid black;">"""
KB4IT_PRED = """https://t00mlabs.net/ontologies/kb4it/has"""
 
ADOC_HELP = """= Help
ADOC_HELP = """= Asciidoc cheatsheet
:Author: t00mlabs
:Category: Documentation
:Scope: Help
48,13 → 48,295
 
// END-OF-HEADER. DO NOT MODIFY OR DELETE THIS LINE
 
== How to
== Introduction
 
Explain how other members can start using this repository
 
* How to publish a new document
* How to write a document
A brief reference of the most commonly used AsciiDoc syntax.
You can find the full documentation for the AsciiDoc syntax at {url-docs}.
 
== Cheatsheet
 
----
== Paragraphs
 
A normal paragraph.
Line breaks are not preserved.
// line comments, which are lines that start with //, are skipped
 
A blank line separates paragraphs.
 
[%hardbreaks]
This paragraph carries the `hardbreaks` option.
Notice how line breaks are now preserved.
 
An indented (literal) paragraph disables text formatting,
preserves spaces and line breaks, and is displayed in a
monospaced font.
 
[sidebar#id.role]
A style, ID, and/or role gives a paragraph (or block) special meaning, like this sidebar.
 
NOTE: An admonition paragraph, like this note, grabs the reader's attention.
 
TIP: Convert this document using the `asciidoctor` command to see the output produced from it.
 
== Text Formatting
:hardbreaks:
 
.Constrained (applied at word boundaries)
*strong importance* (aka bold)
_stress emphasis_ (aka italic)
`monospaced` (aka typewriter text)
"`double`" and '`single`' typographic quotes
+passthrough text+ (substitutions disabled)
`+literal text+` (monospaced with substitutions disabled)
 
.Unconstrained (applied anywhere)
**C**reate+**R**ead+**U**pdate+**D**elete
fan__freakin__tastic
``mono``culture
 
.Replacements
A long time ago in a galaxy far, far away...
(C) 1976 Arty Artisan
I believe I shall--no, actually I won't.
 
.Macros
// where c=specialchars, q=quotes, a=attributes, r=replacements, m=macros, p=post_replacements, etc.
The European icon:flag[role=blue] is blue & contains pass:[************] arranged in a icon:circle-o[role=yellow].
The pass:c[->] operator is often referred to as the stabby lambda.
Since `pass:[++]` has strong priority in AsciiDoc, you can rewrite pass:c,a,r[C++ => C{pp}].
// activate stem support by adding `:stem:` to the document header
stem:[sqrt(4) = 2]
 
:!hardbreaks:
== Attributes
 
// define attributes in the document header; must be flush with left margin
:name: value
 
You can download and install Asciidoctor {asciidoctor-version} from {url-gem}.
C{pp} is not required, only Ruby.
Use a leading backslash to output a word enclosed in curly braces, like \{name}.
 
== Links
 
[%hardbreaks]
https://example.org/page[A webpage]
link:../path/to/file.txt[A local file]
xref:document.adoc[A sibling document]
mailto:hello@example.org[Email to say hello!]
 
== Anchors
 
[[idname,reference text]]
// or written using normal block attributes as `[#idname,reftext=reference text]`
A paragraph (or any block) with an anchor (aka ID) and reftext.
 
See <<idname>> or <<idname,optional text of internal link>>.
 
xref:document.adoc#idname[Jumps to anchor in another document].
 
This paragraph has a footnote.footnote:[This is the text of the footnote.]
 
== Lists
 
=== Unordered
 
* level 1
** level 2
*** level 3
**** level 4
***** etc.
* back at level 1
+
Attach a block or paragraph to a list item using a list continuation (which you can enclose in an open block).
 
.Some Authors
[circle]
- Edgar Allen Poe
- Sheri S. Tepper
- Bill Bryson
 
=== Ordered
 
. Step 1
. Step 2
.. Step 2a
.. Step 2b
. Step 3
 
.Remember your Roman numerals?
[upperroman]
. is one
. is two
. is three
 
=== Checklist
 
* [x] checked
* [ ] not checked
 
=== Callout
 
// enable callout bubbles by adding `:icons: font` to the document header
[,ruby]
----
puts 'Hello, World!' # <1>
----
<1> Prints `Hello, World!` to the console.
 
=== Description
 
first term:: description of first term
second term::
description of second term
 
== Document Structure
 
=== Header
 
// header must be flush with left margin
= Document Title
Author Name <author@example.org>
v1.0, 2019-01-01
 
=== Sections
 
// must be flush with left margin
= Document Title (Level 0)
== Level 1
=== Level 2
==== Level 3
===== Level 4
====== Level 5
== Back at Level 1
 
=== Includes
 
// must be flush with left margin
include::basics.adoc[]
 
// define -a allow-uri-read to allow content to be read from URI
include::https://example.org/installation.adoc[]
 
== Blocks
 
--
open - a general-purpose content wrapper; useful for enclosing content to attach to a list item
--
 
// recognized types include CAUTION, IMPORTANT, NOTE, TIP, and WARNING
// enable admonition icons by setting `:icons: font` in the document header
[NOTE]
====
admonition - a notice for the reader, ranging in severity from a tip to an alert
====
 
====
example - a demonstration of the concept being documented
====
 
.Toggle Me
[%collapsible]
====
collapsible - these details are revealed by clicking the title
====
 
****
sidebar - auxiliary content that can be read independently of the main content
****
 
....
literal - an exhibit that features program output
....
 
----
listing - an exhibit that features program input, source code, or the contents of a file
----
 
[,language]
----
source - a listing that is embellished with (colorized) syntax highlighting
----
 
```language
fenced code - a shorthand syntax for the source block
```
 
[,attribution,citetitle]
____
quote - a quotation or excerpt; attribution with title of source are optional
____
 
[verse,attribution,citetitle]
____
verse - a literary excerpt, often a poem; attribution with title of source are optional
____
 
++++
pass - content passed directly to the output document; often raw HTML
++++
 
// activate stem support by adding `:stem:` to the document header
[stem]
++++
x = y^2
++++
 
////
comment - content which is not included in the output document
////
 
== Tables
 
.Table Attributes
[cols=>1h;2d,width=50%,frame=topbot]
|===
| Attribute Name | Values
 
| options
| header,footer,autowidth
 
| cols
| colspec[;colspec;...]
 
| grid
| all \| cols \| rows \| none
 
| frame
| all \| sides \| topbot \| none
 
| stripes
| all \| even \| odd \| none
 
| width
| (0%..100%)
 
| format
| psv {vbar} csv {vbar} dsv
|===
 
== Multimedia
 
image::screenshot.png[block image,800,450]
 
Press image:reload.svg[reload,16,opts=interactive] to reload the page.
 
video::movie.mp4[width=640,start=60,end=140,options=autoplay]
 
video::aHjpOzsQ9YI[youtube]
 
video::300817511[vimeo]
 
== Breaks
 
// thematic break (aka horizontal rule)
---
 
// page break
<<<
----
"""
 
ADOC_ABOUT = """= About KB4IT
/branches/BR-0.6-uikit/kb4it/src/core/mod_utils.py
25,13 → 25,10
 
log = get_logger('Utils')
 
with open(FILE['HEADER'], 'r') as fhd:
header = fhd.read()
HTML_HEADER = open(FILE['HEADER'], 'r').read()
HTML_FOOTER = open(FILE['FOOTER'], 'r').read()
 
with open(FILE['FOOTER'], 'r') as fft:
footer = fft.read()
 
 
def load_current_kbdict(source_path):
source_path = get_valid_filename(source_path)
KB4IT_DB_FILE = os.path.join(LPATH['DB'], 'kbdict-%s.json' % source_path)
240,17 → 237,19
toc = extract_toc(source)
content = apply_transformations(source)
try:
if 'Metadata' in toc[1]:
# ~ log.error(toc)
if 'Metadata' in content:
content = highlight_metadata_section(content)
except IndexError as error:
# ~ log.error(error)
# Some pages don't have toc section. Ignore it.
pass
 
with open(htmldoc, 'w') as fhtm:
fhtm.write(header % toc)
fhtm.write(HTML_HEADER % toc)
fhtm.write(title)
fhtm.write(content)
fhtm.write(footer)
fhtm.write(HTML_FOOTER)
os.remove(htmldoctmp)
# ~ log.debug("Temporary html document deleted: %s", htmldoctmp)
 
/branches/BR-0.6-uikit/kb4it/src/services/srv_builder.py
62,16 → 62,17
if len(lwords) > 0:
lwords.sort()
 
html = """<div uk-grid="parallax: 150">"""
WORDCLOUD = get_template('WORDCLOUD')
WORDCLOUD_ITEM = get_template('WORDCLOUD_ITEM')
# ~ html = """<div uk-grid="parallax: 150">"""
items = ''
for word in lwords:
frequency = len(dkeyurl[word])
size = get_font_size(frequency, max_frequency)
url = "%s_%s.html" % (get_valid_filename(key), get_valid_filename(word))
chunk = "<div class=\"uk-container-xsmall\"><a class=\"uk-link-heading\" \
style=\"text-decoration: none;\" href=\"%s\"> \
<span style=\"font-size:%dpt;\">%s</span></a></div>" % (url, size, word)
html += chunk
html += "</div>"
item = WORDCLOUD_ITEM % (url, size, word)
items += item
html = WORDCLOUD % items
else:
html = ''