nyuichi / satysfi-base Goto Github PK
View Code? Open in Web Editor NEWcomplementary collection of useful functions and modules for SATySFi
License: MIT License
complementary collection of useful functions and modules for SATySFi
License: MIT License
@zeptometer Can I assign you this issue?
String.of-float Float.nan
returns `-nan`
Should return `nan`
.
May well better look into IEEE-754
the date when I am assigned to the SATySFi advent calendar 2019.
Since version 0.0.5 https://github.com/gfngfn/SATySFi/blob/master/CHANGELOG.md#005---2020-07-11 SATySFi provides primitives log
and exp
for calculation of logarithm and exponentiation.
Please send a message saying "let me join!" in this thread if you wish to become a contributor of this project. Note that, however, being a contributor of this repository does not mean you are fully able to push arbitrary changes to master. Usually we follow the following workflow to make changes in the code in master:
That is, even a non contributor can send us pull requests and even a contributor has to create a pull request whenever, so becoming a contributor is not very important if you just want to send us changes. Instead contributors are assigned reviewing tasks and responsible for checking the given patch works fine.
It would be useful to have a class file such that
We want to use such a class file when we create a figure with SATySFi which will be embedded in another document ofLaTeX or Word.
I found the Block
module in block.satyh
has the following definition
let frame-breakable pads deco f ctx =
block-frame-breakable ctx pads deco f
while it doesn't have frame-breakable
in its signature.
According to the document,
%% If [fill-tail] is true, [Inline.fil] is added at the end of the return value.
If fill-tail
is false, there may be no Inline.fil
in the inline text and sometimes line-break
fails to break it into lines. It seems more user-friendly to set fill-tail
as true by default because that's what we expect in most of the cases.
With satysfi-base v1.2.1 on Satyrographos, we aren't able to @require: base/bool
, are we?
At present, we have unit tests and regression tests to keep quality. We write unit tests by writing all test results to output and compare them with snapshots because we don't have unit testing frameworks for SATySFi.
I published the very first version of satysfi-test. I consider we can try it out, and replace all unit tests to ones with satysfi-test if it works well.
We should have better unit tests using satysfi-test.
typeset/code2.satyh
uses DejaVuSansMono. The trouble is that the vanilla SATySFi doesn't provide the font and users need to install it manually. We can avoid this by adding SATySFi-fonts-dejavu as satyrographos dependency.
I have not tested thoroughly, but it seems that they do not behave correctly. For example, List.drop 0 [3; 1; 4]
evaluates to [1; 4]
.
For detailed steps, refer to 素敵なライブラリをSatyrographosで配布しよう!.
RegExp.exec
is very slow for the following example.
@require: stdja
@require: base/regexp
let longString = ` I do not know why but it seems code2 is slow if it contains a long line.
wakegawakaranaiyo wakegawakaranaiyo wakegawakaranaiyo wakegawakaranaiyo
wakegawakaranaiyo wakegawakaranaiyo wakegawakaranaiyo wakegawakaranaiyo
wakegawakaranaiyo wakegawakaranaiyo wakegawakaranaiyo wakegawakaranaiyo
wakegawakaranaiyo wakegawakaranaiyo wakegawakaranaiyo wakegawakaranaiyo
wakegawakaranaiyo wakegawakaranaiyo wakegawakaranaiyo wakegawakaranaiyo
wakegawakaranaiyo wakegawakaranaiyo wakegawakaranaiyo wakegawakaranaiyo
wakegawakaranaiyo wakegawakaranaiyo wakegawakaranaiyo wakegawakaranaiyo
wakegawakaranaiyo wakegawakaranaiyo wakegawakaranaiyo wakegawakaranaiyo
wakegawakaranaiyo wakegawakaranaiyo wakegawakaranaiyo wakegawakaranaiyo
wakegawakaranaiyo wakegawakaranaiyo wakegawakaranaiyo wakegawakaranaiyo
wakegawakaranaiyo wakegawakaranaiyo wakegawakaranaiyo wakegawakaranaiyo
wakegawakaranaiyo wakegawakaranaiyo wakegawakaranaiyo wakegawakaranaiyo
wakegawakaranaiyo wakegawakaranaiyo wakegawakaranaiyo wakegawakaranaiyo
wakegawakaranaiyo wakegawakaranaiyo wakegawakaranaiyo wakegawakaranaiyo` in
%% This is slow
let slowRegex = RegExp.seq RegExp.bof RegExp.space in
%% These are not slow
let notSlowRegexList = [
RegExp.bof;
RegExp.space;
RegExp.seq RegExp.bof RegExp.alpha;
] in
let _ = RegExp.exec slowRegex longString in
let _ = List.map (fun notSlowRegex -> RegExp.exec notSlowRegex longString) notSlowRegexList in
document (|
title = {slow regexp};
author = {MasWag};
show-title = false;
show-toc = false;
|) '<>
In my environment, a single call of RegExp.exec + (almost minimal typesetting) took about 30 seconds.
real 0m33.527s
user 0m33.334s
sys 0m0.040s
Derive provides typesetting commands for displaying proof trees. We included Drive in satysfi-base for convenience when we didn't have a package management system.
Now that Satyrographos is widely used in the SATySFi community, it's better to have it as an independent package from satysfi-base. Derive provides a different feature from the core concern of satysfi-base.
The current version of SATySFi is 0.0.7 (NOTE: 0.0.8 is not available at opam?), while the current release of satysfi-base supports 0.0.6. satysfi-base should support the latest SATySFi.
Refer to:
To be clarified:
TODO
Color.of-css `invalid#000000`
successfully returns a color value
Should fail with panic
This behavior is because the regex to extract rgb value is #(\h\h)(\h\h)(\h\h)
, which should be ^#(\h\h)(\h\h)(\h\h)$
.
gfngfn/SATySFi#202
We got a way to compare or hash strings!
We want more precise implementations of Float.ceil
, Float.floor
, etc than ZP0.ceil
, ZP0.floor
, etc.
We may want to add tests to confirm that we don't break typesetting libraries (like derive
, code2
, ... etc).
My current idea is leveraging existing tools for front-end development as a first step:
Eq
module expects each (data-type) module to provide eq: 'a Eq.t
, which is essentially an equality function on 'a
.
The current Array
module lacks eq: ('a Array.t) Eq.t
. We want to implement it.
Currently, we use jest-image-snapshot for regression. Tests compile test SATySFi files to pdf files and then convert to images, and finally compare them with snapshots. This was kind of a compromise plan, give that we don't have very good tooling for comparing pdf snapshot directly.
That's why I developed jest-pdf-snapshot. Although it is still unstable, I believe this will helps us have better regression tests.
Replace the current regressions tests with jest-image-snapshot with those with jest-pdf-snapshot.
For detailed steps, refer to 素敵なライブラリをSatyrographosで配布しよう!.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.