Skip to content

Commit

Permalink
0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamSteffanick committed Jan 1, 2020
1 parent abd2038 commit fcff74b
Show file tree
Hide file tree
Showing 9 changed files with 384 additions and 26 deletions.
24 changes: 23 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,26 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p

## [Unreleased]

## [0.5.0] - 2020-01-01
### Added
* [tei.xquery]
* `mvc:minify` ([mvc.xquery])
* `mvc-tei:dispatch` ([tei.xquery])
* `mvc-tei:passthru` ([tei.xquery])
* `mvc-tei:w` ([tei.xquery])
* `mvc-tei:s` ([tei.xquery])
* `mvc-tei:seg` ([tei.xquery])
* `mvc-tei:p` ([tei.xquery])
* `mvc-tei:bibl` ([tei.xquery])
* `mvc-tei:ref` ([tei.xquery])
* `mvc-tei:quote` ([tei.xquery])
* `mvc-tei:q` ([tei.xquery])
* `mvc-tei:hi` ([tei.xquery])
* `mvc-tei:mark` ([tei.xquery])
* `mvc-tei:pb` ([tei.xquery])
* `mvc-tei:lb` ([tei.xquery])
* `mvc-tei:body` ([tei.xquery])

## [0.4.0] - 2019-03-25
### Added
* [mvc.xquery]
Expand Down Expand Up @@ -142,7 +162,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
* [LISENCE]
* [README.md]

[Unreleased]: https://github.com/AdamSteffanick/mvc-xquery/compare/v0.4.0...HEAD
[Unreleased]: https://github.com/AdamSteffanick/mvc-xquery/compare/v0.5.0...HEAD
[0.5.0]: https://github.com/AdamSteffanick/mvc-xquery/compare/v0.4.0...v0.5.0
[0.4.0]: https://github.com/AdamSteffanick/mvc-xquery/compare/v0.3.0...v0.4.0
[0.3.0]: https://github.com/AdamSteffanick/mvc-xquery/compare/v0.2.3...v0.3.0
[0.2.3]: https://github.com/AdamSteffanick/mvc-xquery/compare/v0.2.2...v0.2.3
Expand All @@ -167,6 +188,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
[bootstrap.xquery]: ./modules/bootstrap.xquery
[html5.xquery]: ./modules/html5.xquery
[mvc.xquery]: ./modules/mvc.xquery
[tei.xquery]: ./modules/tei.xquery

[Bootstrap]: https://getbootstrap.com/
[shields.io]: http://shields.io/
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

MVC-XQuery | A Model-View-Controller framework in XQuery for BaseX

Copyright (C) 2018–2019 [Adam Steffanick](https://www.steffanick.com/adam/)
Copyright (C) 2018–2020 [Adam Steffanick](https://www.steffanick.com/adam/)

## Download
* [**Latest release**](https://github.com/AdamSteffanick/mvc-xquery/releases/latest)
Expand Down Expand Up @@ -52,6 +52,7 @@ Copyright (C) 2018–2019 [Adam Steffanick](https://www.steffanick.com/adam/)
* [BaseX] 9.1.2 support
* [Bootstrap] v4.3.1 support
* [HTML5] v5.2 support
* [TEI] P5 support

## Manifest tree
MVC-XQuery should contain:
Expand All @@ -67,11 +68,15 @@ mvc-xquery
│   ├── bootstrap.xquery
│   ├── html5.xquery
│   └── mvc.xquery
│   └── tei.xquery
└── view.xquery
1 directory, 9 files
1 directory, 10 files
```

## Acknowledgments
MVC-XQuery derives from [Experiments with XQuery, RESTXQ, and MVC in BaseX](https://gist.github.com/CliffordAnderson/80c68ea43557446b8331) by [Clifford Anderson](https://github.com/CliffordAnderson) and my work with the members of the TEI, XQuery, Semantic Web, and Linked Data working groups at Vanderbilt University.

## 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.

Expand All @@ -80,7 +85,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

[CHANGELOG]: ./CHANGELOG.md
[version-badge]: https://img.shields.io/badge/mvc--xquery-v0.4.0-0038e2.svg?style=flat-square
[version-badge]: https://img.shields.io/badge/mvc--xquery-v0.5.0-0038e2.svg?style=flat-square
[LICENSE]: ./LICENSE
[license-badge]: https://img.shields.io/badge/license-GPL-0038e2.svg?style=flat-square

Expand All @@ -90,4 +95,5 @@ You should have received a copy of the GNU General Public License along with thi

[BaseX]: http://basex.org/
[Bootstrap]: https://getbootstrap.com/
[HTML5]: https://www.w3.org/TR/html52/
[HTML5]: https://www.w3.org/TR/html52/
[TEI]: https://tei-c.org/guidelines/p5/
6 changes: 3 additions & 3 deletions controller.xquery
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ xquery version "3.1" encoding "UTF-8";
: The MVC-XQuery controller function library module.
:
: MVC-XQuery | A Model-View-Controller framework in XQuery for BaseX
: Copyright (C) 2018–2019 Adam Steffanick
: Copyright (C) 2018–2020 Adam Steffanick
:
: @author Adam Steffanick
: @see https://www.steffanick.com/adam/
: @version v0.4.0
: @version v0.5.0
: @see https://github.com/AdamSteffanick/mvc-xquery
: March 25, 2019
: January 1, 2020
: @since v0.0.2
:
: This program is free software: you can redistribute it and/or modify
Expand Down
6 changes: 3 additions & 3 deletions model.xquery
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ xquery version "3.1" encoding "UTF-8";
: The MVC-XQuery model function library module.
:
: MVC-XQuery | A Model-View-Controller framework in XQuery for BaseX
: Copyright (C) 2018–2019 Adam Steffanick
: Copyright (C) 2018–2020 Adam Steffanick
:
: @author Adam Steffanick
: @see https://www.steffanick.com/adam/
: @version v0.4.0
: @version v0.5.0
: @see https://github.com/AdamSteffanick/mvc-xquery
: March 25, 2019
: January 1, 2020
: @since v0.0.2
:
: This program is free software: you can redistribute it and/or modify
Expand Down
8 changes: 4 additions & 4 deletions modules/bootstrap.xquery
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
xquery version "3.1" encoding "UTF-8";

(:~
: The MVC-XQuery Bootstrap v4.2.1 function library module.
: The MVC-XQuery Bootstrap v4.3.1 function library module.
:
: MVC-XQuery | A Model-View-Controller framework in XQuery for BaseX
: Copyright (C) 2018–2019 Adam Steffanick
: Copyright (C) 2018–2020 Adam Steffanick
:
: @author Adam Steffanick
: @see https://www.steffanick.com/adam/
: @version v0.4.0
: @version v0.5.0
: @see https://github.com/AdamSteffanick/mvc-xquery
: March 25, 2019
: January 1, 2020
: @since v0.2.0
:
: This program is free software: you can redistribute it and/or modify
Expand Down
6 changes: 3 additions & 3 deletions modules/html5.xquery
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ xquery version "3.1" encoding "UTF-8";
: The MVC-XQuery HTML v5.2 function library module.
:
: MVC-XQuery | A Model-View-Controller framework in XQuery for BaseX
: Copyright (C) 2018–2019 Adam Steffanick
: Copyright (C) 2018–2020 Adam Steffanick
:
: @author Adam Steffanick
: @see https://www.steffanick.com/adam/
: @version v0.4.0
: @version v0.5.0
: @see https://github.com/AdamSteffanick/mvc-xquery
: March 25, 2019
: January 1, 2020
: @since v0.3.0
:
: This program is free software: you can redistribute it and/or modify
Expand Down
41 changes: 36 additions & 5 deletions modules/mvc.xquery
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ xquery version "3.1" encoding "UTF-8";
: The MVC-XQuery function library module.
:
: MVC-XQuery | A Model-View-Controller framework in XQuery for BaseX
: Copyright (C) 2018–2019 Adam Steffanick
: Copyright (C) 2018–2020 Adam Steffanick
:
: @author Adam Steffanick
: @see https://www.steffanick.com/adam/
: @version v0.4.0
: @version v0.5.0
: @see https://github.com/AdamSteffanick/mvc-xquery
: March 25, 2019
: January 1, 2020
: @since v0.4.0
:
: This program is free software: you can redistribute it and/or modify
Expand All @@ -34,19 +34,20 @@ module namespace mvc = "mvc";
(: required function library modules :)
import module namespace bootstrap = "bootstrap" at "bootstrap.xquery";
import module namespace html5 = "html5" at "html5.xquery";
import module namespace mvc-tei = "mvc-tei" at "tei.xquery";

(:~
: A public variable containing the MVC-XQuery version.
:
: @author Adam Steffanick
: @see https://www.steffanick.com/adam/
: @version v1.0.0
: @version v1.0.1
: @since v0.4.0
:
: @return one string containing the MVC-XQuery brand
:)
declare %public variable $mvc:version as xs:string := (
"v0.4.0"
"v0.5.0"
);

(:~
Expand Down Expand Up @@ -377,3 +378,33 @@ declare %public function mvc:html-refine(
$refined-input
)
};

(:~
: A public function to minify the HTML5 output of ft:mark() for BaseX.
:
: @author Adam Steffanick
: @see https://www.steffanick.com/adam/
: @version v1.0.0
: @since v0.5.0
:
: @param $parameter is a sequence of zero or more nodes
: @return one minified node
:)
declare %public function mvc:minify($parameter as node()*) {
let $serialization-parameters :=
<serialization-parameters xmlns="http://www.w3.org/2010/xslt-xquery-serialization">
<omit-xml-declaration value="yes"/>
</serialization-parameters>
let $codeString := fn:serialize($parameter, $serialization-parameters)

(: let $codeStringNormalized := fn:replace($codeString, "\s+", " ") :)
let $codeStringMinifyElementWhitespace := fn:replace($codeString, "&#10;\s+", "&#10;")
(: let $codeStringMinifyElementWhitespace2 := fn:replace($codeString, ">\s+<", "><") :)
let $codeStringMinifyCloseSpans := fn:replace($codeStringMinifyElementWhitespace, "</span>\s+</span>", "</span></span>")
let $codeStringMinifyCloseMarkLF := fn:replace($codeStringMinifyCloseSpans, "</mark>&#10;", "</mark>")
let $codeStringMinifyLFCloseI := fn:replace($codeStringMinifyCloseMarkLF, "&#10;</i>", "</i>")
let $codeStringMinifyQuoteLF := fn:replace($codeStringMinifyLFCloseI, "“&#10;", "“")
let $codeStringMinifyLFQuote := fn:replace($codeStringMinifyQuoteLF, "&#10;”", "”")

return fn:parse-xml-fragment($codeStringMinifyLFQuote)
};
Loading

0 comments on commit fcff74b

Please sign in to comment.