diff --git a/Go/WMarkDown.go b/Go/WMarkDown.go index 92653ea..2810bf6 100644 --- a/Go/WMarkDown.go +++ b/Go/WMarkDown.go @@ -170,7 +170,7 @@ var Patterns PatternsModel = PatternsModel{ RE_TRACE_STACK: regexp.MustCompile(`[\n\r](([^\.\(\s]+|\..)+)\([^\n\r]+[\r\n]+\s+([^\:\s]+)\:([0-9]+)`), } -var MAXIMUM_INTEGER int = 2<<31 - 1 +var MAXIMUM_INTEGER int = (1 << 31) - 1 var LIST_MARKS []byte = []byte{'-', '*', '+'} var LIST_LATIN_MARKS []byte = []byte{'a', 'A', 'i', 'I'} var TABLE_MARKS []byte = []byte{'^', '_', '='} @@ -398,9 +398,9 @@ func ModuleSpecialCharacters(matches *PatternMatch, language int, path string) s func GetDirectory(path string) string { - stat, _ := os.Stat(path) + stat, error := os.Stat(path) - if stat.IsDir() { + if error == nil && stat.IsDir() { return path } return filepath.Dir(path) @@ -489,7 +489,8 @@ func ModulePresentationLinks(matches *PatternMatch, language int, path string) s continue } - var has_spaces bool = Patterns.Match(line, Patterns.RE_STARTED_WHITE_SPACES).Ok + var matches *PatternMatch = Patterns.Match(line, Patterns.RE_STARTED_WHITE_SPACES) + var has_spaces bool = matches.Ok && matches.Groups[0] != "" if has_spaces { if i == -1 { @@ -498,7 +499,11 @@ func ModulePresentationLinks(matches *PatternMatch, language int, path string) s if data[0] == '*' { items[i].avatars = append(items[i].avatars, data[1:]) if strings.Contains(data, ".k3y.pw/") { - items[i].avatars = append(items[i].avatars, strings.ReplaceAll(data[1:], ".k3y.pw/", ".local/")) + items[i].avatars = append(items[i].avatars, + strings.ReplaceAll(data[1:], ".k3y.pw/", ".local/"), + strings.ReplaceAll(data[1:], ".k3y.pw/", ".gocal/"), + strings.ReplaceAll(data[1:], ".k3y.pw/", ".cir/"), + ) } } else { items[i].links = append(items[i].links, data) @@ -673,12 +678,12 @@ func (_self *WMarkDown) ModuleTitle(matches *PatternMatch, language int, path st level = strconv.FormatInt(int64(len(level)), 10) if matches.Groups[2] != "" { - content = strings.ToLower(matches.Groups[2]) + content = matches.Groups[2] } else { - content = strings.ToLower(matches.Groups[4]) + content = matches.Groups[4] } - return `` + + return `` + `` + _self.Analyse(content, language, WMD.SUBITEM, path) + `` + `` } @@ -824,7 +829,7 @@ func (_self *WMarkDown) ModuleList(matches *PatternMatch, language int, path str var child_type byte = 'u' - if unordered { + if !unordered { child_type = 'o' } @@ -937,9 +942,9 @@ func (_self *WMarkDown) ModuleTable(matches *PatternMatch, language int, path st for i, tag := range tags { if i == 0 { - html[tag] = row + html[tag] - } else { html[tag] += row + } else { + html[tag] = row + html[tag] } } diff --git a/Public/ecma/WMarkDown.ecma.js b/Public/ecma/WMarkDown.ecma.js index 4544fd7..c1373f6 100644 --- a/Public/ecma/WMarkDown.ecma.js +++ b/Public/ecma/WMarkDown.ecma.js @@ -91,14 +91,24 @@ export const WMarkDown = (function(){ let loaded = 0; /** @type {Array.} */ const dictionaries = inputs.dictionary instanceof Array ? inputs.dictionary : [inputs.dictionary], - /** - * @returns {void} - */ - end = () => ++ loaded == dictionaries.length && (dictionary_loaded = true); + /** @type {Array.>, string|Array., string|Array.>>} */ + sets = [], + /** + * @returns {void} + */ + end = () => { + if(++ loaded == dictionaries.length){ + sets.forEach(subset => { + subset && self.add_to_dictionary(subset); + }); + dictionary_loaded = true; + }; + }; - dictionaries.forEach(url => WMarkDown.get(url, data => { + dictionaries.forEach((url, i) => WMarkDown.get(url, data => { try{ - self.add_to_dictionary(JSON.parse(data)); + sets[i] = JSON.parse(data); + // self.add_to_dictionary(JSON.parse(data)); }catch(exception){ console.error(exception); }; @@ -121,6 +131,8 @@ export const WMarkDown = (function(){ patterns[0] instanceof Array || (patterns = [patterns]); + console.log([patterns, definition]); + patterns.forEach(([pattern, text]) => { if(!dictionary_done.includes(text)){ if(i === null) @@ -695,9 +707,27 @@ export const WMarkDown = (function(){ return dictionary_item_mark[0] + (own_keys.length - 1) + dictionary_item_mark[1]; }) ), dictionary[i].definition).replace(dictionary_item_mark[2], (all, i) => `` + own_keys[i] + ``) + ` - + `); // box.style.zIndex = dictionary_z ++; diff --git a/Public/json/WMarkDown.dict.es.kyman.json b/Public/json/WMarkDown.dict.es.kyman.json index a8378b5..f4c000f 100644 --- a/Public/json/WMarkDown.dict.es.kyman.json +++ b/Public/json/WMarkDown.dict.es.kyman.json @@ -132,15 +132,19 @@ ], [] ], [ [ + ["/\\b(a[n&]p *|a\\.n\\.p\\.|a\\. +n\\. +p\\. +)lite\\b/ig", "AnP Lite"], ["/\\b(a[n&]p\\b|a\\.n\\.p\\.|a\\. +n\\. +p\\. +)/ig", "AnP"], + ["/\\battach +and +play +lite\\b/gi", "Attach and Play Lite"], ["/\\battach +and +play\\b/gi", "Attach and Play"] ], [ "AnP (Attach and Play) es un proyecto a modo Framework para desarrollar aplicaciones, ", "principalmente aplicaciones Web aunque se puede extender a juegos, aplicaciones de ", - "escritorio o de terminal/consola de comandos, desarrollado por KyMAN." + "escritorio o de terminal/consola de comandos, desarrollado por KyMAN. Su versión Lite ", + "es una versión ultraligera para altor rendimiento." ], [ "https://anp.k3y.pw/", - "https://git.k3y.pw/AnP/AnP" + "https://git.k3y.pw/AnP/AnP", + "https://git.k3y.pw/Lite/AnP" ] ], [ ["/\\b((?[data-icon=deploy]{ @@ -83,6 +83,42 @@ } } +.wmd-icon.checkbox>input+span::before{content : unicode("f0c8"); font-family : "FA6FR";} +.wmd-icon.checkbox>input:disabled+span::before{content : unicode("f0c8"); font-family : "FA6FS"; opacity : .5;} +.wmd-icon.checkbox>input:checked+span::before{content : unicode("f14a"); font-family : "FA6FR";} +.wmd-icon.radio-button>input+span::before{content : unicode("f111"); font-family : "FA6FR";} +.wmd-icon.radio-button>input:disabled+span::before{content : unicode("f111"); font-family : "FA6FS"; opacity : .5;} +.wmd-icon.radio-button>input:checked+span::before{content : unicode("f192"); font-family : "FA6FR";} +.wmd-icon.tick>input+span::before{content : unicode("f00d"); font-family : "FA6FS";} +.wmd-icon.tick>input:disabled+span::before{content : unicode("f560"); font-family : "FA6FS";} +.wmd-icon.tick>input:checked+span::before{content : unicode("f00c"); font-family : "FA6FS";} +.wmarkdown [data-icon=warning]::before,.wmarkdown [data-icon=warn]::before{content : unicode("f071"); font-family : "FA6FS";} +.wmarkdown [data-icon=ask]::before,.wmarkdown [data-icon=question]::before{content : unicode("f059"); font-family : "FA6FS";} +.wmarkdown [data-icon=answer]::before{content : unicode("f138"); font-family : "FA6FS";} +.wmarkdown [data-icon=comment]::before{content : unicode("f075"); font-family : "FA6FR";} +.wmarkdown [data-icon=note]::before{content : unicode("f249"); font-family : "FA6FR";} +.wmarkdown [data-icon=characters]::before{content : unicode("f031"); font-family : "FA6FS";} +.wmarkdown [data-icon=lines]::before{content : unicode("f039"); font-family : "FA6FS";} +.wmd-code-block [data-icon=type]::before{content : unicode("f15b"); font-family : "FA6FR";} +.wmd-code-block[data-type=html] [data-icon]::before{content : unicode("f1c9"); font-family : "FA6FR";} +.wmarkdown [data-icon=link]::before{content : unicode("f0c1"); font-family : "FA6FS";} +.wmarkdown [data-deployed=true]>[data-icon=deploy]::before, +.wmd-main-menu [data-deployed=true]>[data-icon=deploy]::before{content : unicode("f146"); font-family : "FA6FR";} +.wmarkdown [data-deployed=false]>[data-icon=deploy]::before, +.wmd-main-menu [data-deployed=false]>[data-icon=deploy]::before{content : unicode("f0fe"); font-family : "FA6FR";} +.wmd-main-menu-button [data-icon=menu]::before{content : unicode("f0c9"); font-family : "FA6FS";} +.wmarkdown [data-icon=view_switch]::before{content : unicode("f074"); font-family : "FA6FS";} +.wmd-dictionary-box a{ + &[data-type=phone],&[data-type=mail],&[data-type=samba]{&::before{ + display : inline-block; + padding : .4em 0em; + font-family : "FA6FS"; + }} + &[data-type=samba]::before{content : unicode("");} + &[data-type=phone]::before{content : unicode("f095");} + &[data-type=mail]::before{content : "@";} +} + .wmd-icon>input{display : none;} .wmd-code-block{ display : block; @@ -212,22 +248,25 @@ } } -[data-include]{ - &>.link{ - margin-top : 2em; - font-size : .9em; - opacity : .8; +.wmd{ + [data-include]{ + &>.link{ + margin-top : 2em; + font-size : .9em; + opacity : .8; + } + @for $i from 1 through 6{ + // font-size : (6 - $i) * 3em; + &+h#{$i}{margin-top : 0em;} + &>.wmarkdown{&>h#{$i}{&:first-child{margin-top : 0em;}}} + } + [data-include]>.link>a{display : none;} } - @for $i from 1 through 6{ - font-size : (6 - $i) * 3em; - &+h#{$i}{margin-top : 0em;} - &>.wmarkdown{&>h#{$i}{&:first-child{margin-top : 0em;}}} - } - [data-include]>.link>a{display : none;} + @for $i from 1 through 6{h#{$i}{font-size : (7 - $i) * .4 + 1em;}} } .wmd-title{ - &>:last-child{ + &>span+span:last-child{ margin-left : .3em; font-size : .6em; span{ @@ -279,6 +318,15 @@ } } +.wmd{ + span{&[data-deployed=false],&[data-deployed=true]{cursor : pointer;}} + &>ul{margin : 1em 0em;} + ul{ + padding : 0em 2em; + font-size : 1em; + } +} +.wmd-main-menu ul{list-style-type : none;} .wmd-list,.wmd-main-menu{ [data-deployed=false]{&~ul,&~ol{display : none;}} [data-icon=deploy]{ @@ -287,7 +335,7 @@ } } -.wmd,.wmd-dictionary-box{.wmd-dictionary-item[data-role]{cursor : help;}} +.wmd,.wmd-dictionary-box{.wmd-dictionary-item[data-role][data-i]{cursor : help;}} .wmd-dictionary-box{ position : absolute; max-width : 15em; @@ -306,6 +354,7 @@ margin : .3em; border-width : .1em; border-style : solid; + vertical-align : middle; background-position : center center; background-size : cover; box-sizing : border-box; diff --git a/Public/scss/WMarkDown.common.scss b/Public/scss/WMarkDown.common.scss index 0dd3672..2af7d1b 100644 --- a/Public/scss/WMarkDown.common.scss +++ b/Public/scss/WMarkDown.common.scss @@ -1,6 +1,6 @@ -@use "sass:map"; -@use "sass:list"; -@use "sass:meta"; +// @use "sass:map"; +// @use "sass:list"; +// @use "sass:meta"; @function unicode($code){ @return unquote("\"") + unquote(str-insert($code, "\\", 1)) + unquote("\""); diff --git a/version b/version index 3de660d..c782bda 100644 --- a/version +++ b/version @@ -1 +1 @@ -0.0.3.9 \ No newline at end of file +0.0.3.10 \ No newline at end of file