Skip to content

Commit

Permalink
Preparations for version 1.7
Browse files Browse the repository at this point in the history
add tagging support, issue #15
  • Loading branch information
cereda authored Jul 23, 2024
2 parents 4bc99dc + 56334dc commit 4eafff3
Show file tree
Hide file tree
Showing 6 changed files with 1,314 additions and 4 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]

## [1.7] - 2024-07-23

### Added

- Tagging support. (see #15)

## [1.6] - 2023-03-04

### Fixed
Expand Down Expand Up @@ -70,7 +76,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

- First public release.

[Unreleased]: https://github.com/cereda/sillypage/compare/v1.6...HEAD
[Unreleased]: https://github.com/cereda/sillypage/compare/v1.7...HEAD
[1.7]: https://github.com/cereda/sillypage/compare/v1.6...v1.7
[1.6]: https://github.com/cereda/sillypage/compare/v1.5...v1.6
[1.5]: https://github.com/cereda/sillypage/compare/v1.4...v1.5
[1.4]: https://github.com/cereda/sillypage/compare/v1.3...v1.4
Expand Down
2 changes: 1 addition & 1 deletion build.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ typesetfiles = { "*.dtx", "*.tex" }

textfiles = { "README.md" }

checkruns = 1
checkruns = 3
typesetruns = 3

checkengines = { "pdftex" }
Expand Down
Binary file modified sillypage-example.pdf
Binary file not shown.
34 changes: 32 additions & 2 deletions sillypage.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
% by Phelype Oleinik, Paulo Cereda, samcarter and Ulrike Fischer.
%
%<*package>
\def\sillypageDate{2023-03-04}
\def\sillypageVersion{1.6}
\def\sillypageDate{2024-07-23}
\def\sillypageVersion{1.7}
%</package>
%<*driver>
\documentclass[a4paper,full]{l3doc}
Expand Down Expand Up @@ -261,9 +261,13 @@
\newcommand*\@silly { \@@_step:n }
\cs_new:Npn \@@_step:n #1
{
\UseTaggingSocket{@@/begin}{#1}
\SuspendTagging{@@}
\@@_step_aux:eN
{ \int_eval:n { \int_mod:nn { #1-1 } { \silly@steps } +1 } }
\c_false_bool
\ResumeTagging{@@}
\UseTaggingSocket{@@/end}
}
% \end{macrocode}
% \end{macro}
Expand All @@ -280,15 +284,41 @@
\newcommand*\@sillynumeral { \@@_numeral:n }
\cs_new:Npn \@@_numeral:n #1
{
\UseTaggingSocket{@@/begin}{#1}
\SuspendTagging{@@}
\exp_args:Ne \str_map_function:nN
{ \int_to_base:nn {#1} { 12 } } \@@_numeral_aux:n
\ResumeTagging{@@}
\UseTaggingSocket{@@/end}
}
\cs_new:Npn \@@_numeral_aux:n #1
{ \@@_step_aux:eN { "\char_uppercase:N #1+1 } \c_true_bool }
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsection{Tagging Support}

% \begin{macrocode}
\NewSocket{tagsupport/@@/begin}{1}
\NewSocket{tagsupport/@@/end}{0}
\NewSocketPlug{tagsupport/@@/begin}{tagged}
{
\mode_leave_vertical:
\tag_mc_end_push:
\tag_struct_begin:n {tag=Span}
\tag_mc_begin:n {actualtext=#1}
}
\NewSocketPlug{tagsupport/@@/end}{tagged}
{
\tag_mc_end:
\tag_struct_end:
\tag_mc_begin_pop:n{}
}
\AssignSocketPlug{tagsupport/@@/begin}{tagged}
\AssignSocketPlug{tagsupport/@@/end}{tagged}
% \end{macrocode}
%
% \subsection{Internals}
%
Expand Down
27 changes: 27 additions & 0 deletions testfiles/sillypage003.pvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
\ExplSyntaxOn
\sys_gset_rand_seed:n{1000}
\ExplSyntaxOff
\DocumentMetadata
{
lang=en-US,
pdfversion=2.0,
pdfstandard=ua-2,
testphase={phase-III,math,table,title,firstaid},
uncompress
}
\input{regression-test}
\documentclass{article}
\usepackage{sillypage}

\pagenumbering{silly}
\begin{document}
\section{test}
\sillystep{10}

\silly{section}

\setcounter{page}{24}

\sillynumeral{25}

\end{document}
Loading

0 comments on commit 4eafff3

Please sign in to comment.