Skip to content

Instantly share code, notes, and snippets.

@youz
Last active April 8, 2020 08:32
Show Gist options
  • Save youz/ea466325e29d42f98ad6e6e6d2073910 to your computer and use it in GitHub Desktop.
Save youz/ea466325e29d42f98ad6e6e6d2073910 to your computer and use it in GitHub Desktop.
sd.saty
Display the source blob
Display the rendered blob
Raw
@require: stdjareport
let-block ctx +distance r it =
let () = if 1pt *' r <' 2pt then abort-with-message `keep a distance` else () in
let d = (get-font-size ctx) *' r in
let dctx = ctx |> set-leading (d *' 1.5)
|> set-space-ratio r 0. (r *. 10.)
|> set-paragraph-margin d d
in
read-inline dctx it ++ inline-fil
|> form-paragraph dctx
let sample = {
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
}
in
document (| author = {}; title = {}; |)
'<
+p(sample);
+distance(2.0)(sample);
+distance(5.0)(sample);
>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment