Skip to content

Commit

Permalink
Prepare release
Browse files Browse the repository at this point in the history
  • Loading branch information
deathaxe committed Dec 5, 2024
1 parent 0944c96 commit 1a975fa
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@
.gitattributes export-ignore
.gitignore export-ignore

# Screenshots
preview.* export-ignore

# Development
tests/ export-ignore
*.cmd export-ignore
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Sublime Text Syntax definition, completions and snippets for [XPath](https://www.w3.org/TR/xpath), [XML Schema](https://www.w3.org/XML/Schema) and [XML Stylesheet Transformation](https://www.w3.org/TR/xslt20/) files.

![preview](preview.png)

## Installation

### Package Control
Expand Down Expand Up @@ -447,3 +449,19 @@ Snippets to work with XSL transformation.
```
<xsl:with-param name="${1}" select="${2}" />
```

## Troubleshooting

### §1 Syntax Definition Parse Errors

XSL extends Sublime Text's _Regular Expressions_ and _XML_ syntax definition.

If XSL syntax highlighting doesn't work
and console displays syntax errors in _XSD.sublime-syntax_ or _XSL.sublime-syntax_
please make sure to remove any out-dated syntax override.

Steps:

1. call _Menu > Preferences > Browse Packages.._
2. Look for _XML_ folder
3. Remove it or at least delete any syntax definition in it.
57 changes: 57 additions & 0 deletions make.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
@echo off
setlocal
chcp 65001 >nul
pushd %~dp0

if /i "%1" == "release" goto RELEASE
goto :usage

:RELEASE
if "%2"== "" goto :usage
set version=%2

for %%d in ("%~dp0.") do set package=%%~nxd

echo Creating assets for "%package%"...

:: create tag and download asset for ST3
set build=3
set branch=st%build%
set tag=st%build%-%version%
set archive=%package%-%version%-st%build%.sublime-package
set assets="%archive%#%archive%"
call git tag -f %tag% %branch%
call git archive --format zip -o "%archive%" %tag%

:: create tag and download asset for ST4126+ (master branch)
set build=4107
set branch=st%build%
set tag=%build%-%version%
set archive=%package%-%version%-st%build%.sublime-package
set assets=%assets% "%archive%#%archive%"
call git tag -f %tag% %branch%
call git archive --format zip -o "%archive%" %tag%

:: create tag and download asset for ST4126+ (master branch)
set build=4126
set branch=master
set tag=%build%-%version%
set archive=%package%-%version%-st%build%.sublime-package
set assets=%assets% "%archive%#%archive%"
call git tag -f %tag% %branch%
call git archive --format zip -o "%archive%" %tag%

:: create github release (on master branch using latest tag)
git push --tags --force
gh release create --target %branch% -t "%package% %version%" "%tag%" %assets%
del /f /q *.sublime-package
git fetch
goto :eof

:USAGE
echo USAGE:
echo.
echo make ^[release^]
echo.
echo release ^<semver^> -- create and publish a release (e.g. 1.2.3)
goto :eof
Binary file added preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions preview.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="xs"
version="2.0">
<xsl:output omit-xml-declaration="yes"/>

<xsl:template match="/">
<xsl:text>INSERT ALL </xsl:text>

<!-- Iterates all the rows from all the tables of the document -->
<xsl:for-each select="//tr[@attr='foo']">

<!-- Skip the table header -->
<xsl:if test="generate-id(.)!=generate-id(../tr[1])">
<xsl:text>INTO conversion VALUES(</xsl:text>
<!-- Extracts the cells -->
<xsl:for-each select="tc">
'<xsl:value-of select="replace(normalize-space(.), '^pe([a-z-[bcd]]{2,4})$', 'item $1')"/>'
</xsl:for-each>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:for-each>

<xsl:text>SELECT * FROM dual</xsl:text>

</xsl:template>
</xsl:stylesheet>

0 comments on commit 1a975fa

Please sign in to comment.