Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wikiformat #164

Open
wants to merge 54 commits into
base: gh-pages
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
b0316a7
wikiformat in progress
mistermboy Jun 29, 2020
051565a
wikiFormat v0
mistermboy Jun 30, 2020
3ab6360
working on #153
mistermboy Jul 7, 2020
db7e801
solved #153
mistermboy Jul 7, 2020
ba3d3af
fixed comments after shapes
mistermboy Jul 7, 2020
667e15b
solved cypress dependency problem
mistermboy Jul 10, 2020
8d6cf2b
shor valueSets tags
mistermboy Jul 10, 2020
5ed79e5
fixed getSemicolonIfNeedeed
mistermboy Jul 10, 2020
da48928
solved #157
mistermboy Jul 10, 2020
c5ac307
fixed hasComments method
mistermboy Jul 13, 2020
cbaa21b
prettyprinter behaviour change with one line inlineshapes
mistermboy Jul 13, 2020
b502c05
wikiformat scroll oK
mistermboy Jul 13, 2020
6a4f49a
pretty comments (ugly code)
mistermboy Jul 13, 2020
e481848
prettifyComments
mistermboy Jul 13, 2020
26a2467
check yashe errors before wikiformat
mistermboy Jul 13, 2020
343088b
undo/redo history wikiformat
mistermboy Jul 13, 2020
26202e1
tooltipUtils refactor
mistermboy Jul 14, 2020
62e36de
getEntityData
mistermboy Jul 14, 2020
749dc19
fixed entityData.title exception
mistermboy Jul 14, 2020
99655e7
wikiFormat btn adjustment
mistermboy Jul 15, 2020
308af36
...
mistermboy Jul 22, 2020
a6099f6
removed unused method in node.js
mistermboy Jul 29, 2020
ab584a5
removed wikidata cache
mistermboy Jul 29, 2020
df1e7b0
removed logs
mistermboy Jul 29, 2020
9374353
fixed valueSet bug with <...>
mistermboy Jul 30, 2020
48cd53b
fixed simple tconstraint bug
mistermboy Jul 30, 2020
e33f0ef
[PRETTY] afterTriples
mistermboy Jul 30, 2020
c904eab
increased performance
mistermboy Jul 30, 2020
6401713
[Autocompleters] Ctrl-Space msg and autoshows
mistermboy Jul 31, 2020
f31ce55
[Autocompleters] Keywords and prefixes splited
mistermboy Jul 31, 2020
c328fa5
[Autocompleters] Wikibase adjustment
mistermboy Jul 31, 2020
e2f421a
wikiformat in progress msg
mistermboy Aug 3, 2020
373e826
wikistop btn
mistermboy Aug 3, 2020
bb94939
enable/disable editor while format
mistermboy Aug 3, 2020
407f5ff
new wikiformat logo
mistermboy Aug 3, 2020
02a95dc
Generate Wikidata COmments example
mistermboy Aug 3, 2020
56ea916
multicomments in the same line with just one #
mistermboy Aug 4, 2020
aee484e
prettyfyOnStop
mistermboy Aug 4, 2020
560b6a3
fixed wikiformat bug when non wikidata entities iris before constraints
mistermboy Aug 4, 2020
b2875d0
fixed #159
mistermboy Aug 4, 2020
b96d383
LOGICAL_OR const
mistermboy Aug 4, 2020
1de09d8
error check pretty
mistermboy Aug 4, 2020
bda7cae
alermsg when errors before wikiformat
mistermboy Aug 5, 2020
92ca5f9
solved prettyprint bug with | after non existing triples
mistermboy Aug 5, 2020
a1bb31b
rm blank comments
mistermboy Aug 6, 2020
3223cdd
fixed history problem
mistermboy Aug 6, 2020
4ae7dfe
title wikiBtn
mistermboy Aug 7, 2020
bf9ca97
solved #150
mistermboy Aug 10, 2020
27ebec4
solved #149
mistermboy Aug 10, 2020
53f3a13
solved #163
mistermboy Aug 10, 2020
293846b
solved small bug with ]
mistermboy Aug 10, 2020
7234982
wikiformat new replacement comments system
mistermboy Aug 11, 2020
2fbf431
Delete Example-77-Difference-between-Or-and-|
mistermboy Nov 11, 2020
e33899b
dependency update
mistermboy Nov 11, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,213 changes: 789 additions & 424 deletions dist/yashe.bundled.min.js

Large diffs are not rendered by default.

41 changes: 25 additions & 16 deletions dist/yashe.css
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
color: #A9B7C6;
border: 10px; }
.yashe .cm-s-dark .cm-shape {
color: #68BEEB; }
color: #8fd5fa; }
.yashe .cm-s-dark .cm-keyword {
color: #f00; }
color: #ff5656; }
.yashe .cm-s-dark .cm-atom {
color: #219; }
.yashe .cm-s-dark .cm-number {
Expand All @@ -109,26 +109,24 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
.yashe .cm-s-dark .cm-property,
.yashe .cm-s-dark .cm-operator {
color: #05a; }
.yashe .cm-s-dark .cm-variable-2 {
color: #68BEEB; }
.yashe .cm-s-dark .cm-variable-3 {
color: #68BEEB; }
color: #8fd5fa; }
.yashe .cm-s-dark .cm-comment {
color: #999; }
.yashe .cm-s-dark .cm-string {
color: #b98003; }
.yashe .cm-s-dark .cm-string-2 {
color: #7DB647; }
color: #a1df67; }
.yashe .cm-s-dark .cm-constraint {
color: #7DB647; }
color: #a1df67; }
.yashe .cm-s-dark .cm-valueSet {
color: #7DB647; }
color: #a1df67; }
.yashe .cm-s-dark .cm-constraintKeyword {
color: #f00; }
color: #ff5656; }
.yashe .cm-s-dark .cm-facet {
color: #f00; }
color: #ff5656; }
.yashe .cm-s-dark .cm-shapeRef {
color: #68BEEB; }
color: #8fd5fa; }
.yashe .cm-s-dark .cm-meta {
color: #555; }
.yashe .cm-s-dark .cm-qualifier {
Expand All @@ -142,13 +140,13 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
.yashe .cm-s-dark .cm-attribute {
color: #00c; }
.yashe .cm-s-dark .cm-hr {
color: #999; }
color: #e42727; }
.yashe .cm-s-dark .cm-link {
color: #00c; }
.yashe .cm-s-dark .cm-punc {
color: #FFFFFF; }
.yashe .cm-s-dark .cm-logical {
color: #B271FF; }
color: #ff5656; }
.yashe .cm-s-dark .cm-at {
color: #68BEEB; }
.yashe .cm-s-dark .cm-prefixDelcAlias {
Expand Down Expand Up @@ -653,12 +651,23 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
margin-top: 2px;
display: inline-block; }
.yashe .yashe_shareBtn {
margin-right: 8px;
margin-right: px;
margin-top: 2px; }
.yashe .shareInput {
border-radius: 3px;
width: 250px;
border: 1px solid #222; }
.yashe .yashe_wikiBtn {
margin-right: 8px !important; }
.yashe .yashe_wikiBtnAfter {
margin-right: 14px !important;
margin-left: -3px !important; }
.yashe .yashe_stopBtn {
margin-right: 10px;
margin-left: -1px !important;
fill: red !important; }
.yashe .yashe_stopBtn:hover {
filter: invert(0) sepia(0) hue-rotate(0deg) saturate(0) brightness(0) !important; }
.yashe .CodeMirror {
line-height: 1.5em;
border: 1px solid #d1d1d1; }
Expand Down Expand Up @@ -699,12 +708,12 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
color: red;
font-weight: bold;
float: left; }
.yashe .completionNotification {
.yashe .notification {
color: #999;
background-color: #f7f7f7;
position: absolute;
padding: 0px 5px;
right: 0px;
right: 1.5%;
bottom: 0px;
font-size: 90%; }
.yashe .parseErrorIcon {
Expand Down
2 changes: 1 addition & 1 deletion dist/yashe.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion doc/examples/others/pretty
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@



# PRESS CTRL-F / Cmd-F
# PRESS Shift-Ctrl-F / Shift-Cmd-F

PREFIX : <http://example.org/> PREFIX schema: <http://schema.org/> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> :User { schema:name xsd:string ; schema:birthDate xsd:date ? ; schema:gender [ schema:Male schema:Female ] OR xsd:string ; schema:knows IRI @:User * } PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX wd: <http://www.wikidata.org/entity/> PREFIX wdt: <http://www.wikidata.org/prop/direct/> start = @<human> <human> EXTRA wdt:P31 { wdt:P31 [ wd:Q5 ] ; wdt:P21 [ wd:Q6581097 wd:Q6581072 wd:Q1097630 wd:Q1052281 wd:Q2449503 wd:Q48270 ] ? ; wdt:P19 . ? ; wdt:P569 . ? ; wdt:P735 . * ; wdt:P734 . * ; wdt:P106 . * ; wdt:P27 @<country> * ; wdt:P22 @<human> * ; wdt:P25 @<human> * ; wdt:P3373 @<human> * ; wdt:P26 @<human> * ; wdt:P40 @<human> * ; wdt:P1038 @<human> * ; wdt:P103 @<language> * ; wdt:P1412 @<language> * ; wdt:P6886 @<language> * ; rdfs:label rdf:langString + } <country> EXTRA wdt:P31 { wdt:P31 [ wd:Q6256 wd:Q3024240 wd:Q3624078 ] + } <language> EXTRA wdt:P31 { wdt:P31 [ wd:Q34770 wd:Q1288568 ] + }

Expand Down
39 changes: 39 additions & 0 deletions doc/examples/others/wikiComments
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@


# Press the second button ----------------------------------------------------------------------> 1 2 3 4 5 6 7 8

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

start = @<human>

<human> EXTRA wdt:P31 {
wdt:P31 [wd:Q5];
wdt:P21 [wd:Q6581097 wd:Q6581072 wd:Q1097630 wd:Q1052281 wd:Q2449503 wd:Q48270]?;
wdt:P19 . ?;
wdt:P569 . ? ;
wdt:P735 . * ;
wdt:P734 . * ;
wdt:P106 . * ;
wdt:P27 @<country> *;
wdt:P22 @<human> *;
wdt:P25 @<human> *;
wdt:P3373 @<human> *;
wdt:P26 @<human> *;
wdt:P40 @<human> *;
wdt:P1038 @<human> *;
wdt:P103 @<language> *;
wdt:P1412 @<language> *;
wdt:P6886 @<language> *;
rdfs:label rdf:langString+;
}

<country> EXTRA wdt:P31 {
wdt:P31 [wd:Q6256 wd:Q3024240 wd:Q3624078] +;
}

<language> EXTRA wdt:P31 {
wdt:P31 [wd:Q34770 wd:Q1288568] +;
}

This file was deleted.

21 changes: 8 additions & 13 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@

<div class="row" id="aboutYQuery">
<div class="col-md-12">
<h1>About YASHE</h1>
YASHE is a <a target="_blank" href='http://shex.io/shex-semantics/'>ShEx</a> editor which started as a fork of <a target="_blank" href='https://yasqe.yasgui.org/'>YASQE</a> (which is based on SPARQL)
This tool performs lexical and syntactic analysis of the content of the editor, thus offering the user a realtime syntactic error detector.
It has features like: syntax highlighting, visual aid elements (tooltips) and autocomplete mechanisms. In addition, it offers a simple way of integrating into other projects.

<div class="selectors">
<select id="rdfBookSelector" class="exSelector form-control">
<option value="" disabled selected>Validating RDF Data Book Examples</option>
Expand All @@ -66,6 +61,7 @@ <h1>About YASHE</h1>
<option value="japan">Japan Sarch Metadata</option>
<option value="wikibase">Wikibase Instances Autocomple and Tooltip</option>
<option value="pretty">Pretty Print</option>
<option value="wikiComments">Generate Wikidata Comments</option>
</select>
</div>

Expand All @@ -76,6 +72,12 @@ <h1>About YASHE</h1>
</div>
</div>

<h1>About YASHE</h1>
YASHE is a <a target="_blank" href='http://shex.io/shex-semantics/'>ShEx</a> editor which started as a fork of <a target="_blank" href='https://yasqe.yasgui.org/'>YASQE</a> (which is based on SPARQL)
This tool performs lexical and syntactic analysis of the content of the editor, thus offering the user a realtime syntactic error detector.
It has features like: syntax highlighting, visual aid elements (tooltips) and autocomplete mechanisms. In addition, it offers a simple way of integrating into other projects.


<div class="row" id="features">
<div class="col-md-12">
<h1>Features</h1>
Expand Down Expand Up @@ -188,16 +190,9 @@ <h1>Thanks!</h1>
persistent:null
});

yashe.setSize(1135,400);

//yashe.prettify();
//yashe.wikiformat();
//yashe.prettify();

yashe.setSize(1135,500);
</script>




</body>
</html>
6 changes: 3 additions & 3 deletions lib/grammar/tokenizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ CodeMirror.defineMode("shex", function(config, parserConfig) {
state.defShapes[tokenOb.text] = tokenOb
tokenOb.style='shape';
}
// console.log({topSymbol:topSymbol,tokenOb:tokenOb.text})
if(topSymbol == 'valueSetValue')tokenOb.style='valueSet';
//if(tokenOb.cat == 'ATPNAME_LN')tokenOb.style='shapeRef';
if(topSymbol=='cardinality')tokenOb.style='cardinality';
Expand All @@ -521,15 +522,14 @@ CodeMirror.defineMode("shex", function(config, parserConfig) {

if(topSymbol=='nodeConstraint'){
if(token!='['){
if(!token.match(grammar.keywords)){
tokenOb.style='constraint';
if(!token.match(grammar.keywords) || token == 'IRI_REF'){ // IRI_REF MATCHES WITH IRI
tokenOb.style='constraint';
}else{
tokenOb.style='constraintKeyword';
}
}
}


if (!ll1_table[topSymbol]) {
// Top symbol is a terminal
if (topSymbol == token) {
Expand Down
Loading