Reduce space between rendered rules of a judgement form

オープン
#264 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
領域
design

調査の方向性

スタンドアロンの例と render-judgment-form エントリーポイントから始め、一覧にあるスペーシングパラメータが judgment-form のレイアウトにどのような影響を与えるかを追跡します。要求されたコンパクトなスペーシングを、スクリーンショットに示されている horizontal-bar-spacing の動作と比較します。レンダリングされたルールをコンパクトにでき、強調表示されたバーのスペーシングが一貫して動作すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

I have quite a large judgment form to be rendered for a paper, and I would like to somewhat compact it by reducing the space between the different rules. A standalone excerpt of the judgment form can be found below. To demonstrate, I set all of the "spacing" parameters that I could find to 0, even when they do not affect the rendering of judgment forms.

As a sidenote, I have noticed that, in some cases, the parameter horizontal-bar-spacing reduces only the space above a horizontal bar, and not below. In the screenshot below the code I highlighted one such instance with a red arrow. Possibly related to the inclusion of a unicode union character in the bottom line?

#lang racket

(require redex
         redex/pict)
(define-language CommonLang
  (k ::= number i)
  (p ::= (k ...)) 
  (p-exp ::= k * [script-op (~ k ...)] [script-op k] [⋃ k ...]))

(define-judgment-form
  CommonLang
  #:mode     (matches-in-env I I I)
  #:contract (matches-in-env ps p env)
  
  [--------------------------------- "empty-selector"
   (matches-in-env () () env)]
  [(matches-in-env (p-exp ...) (k_2 ...) env)
   --------------------------------- "literal-key"
   (matches-in-env (k_1 p-exp ...) (k_1 k_2 ...) env)]
  [(matches-in-env (k_1 p-exp ...) (k_2 ...) env)
   --------------------------------- "union-first"
   (matches-in-env ([⋃ k_1 k_3 ...] p-exp ...) (k_2 ...) env)])

(define (render-matches-in-env . filepath)
  (arrow-space 0)
  (label-space 0)
  (reduction-relation-rule-separation 0) 
  (reduction-relation-rule-extra-separation 0)
  (reduction-relation-rule-line-separation 0)
  (horizontal-bar-spacing 0)
  (metafunction-gap-space 0)
  (metafunction-rule-gap-space 0)
  (metafunction-line-gap-space 0)

  (if (empty? filepath)
      (render-judgment-form matches-in-env)
      (render-judgment-form matches-in-env (car filepath))))

The space that I wish to somewhat reduce highlighted with a red bar, and an instance of horizontal-bar-spacing not respecting being set to 0 is highlighted with a red arrow.

annotated-space

主要言語
Racket
スター
114
フォーク
42
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

racket/redex のほかの issue

racket/redex の issue をすべて見る

似ている issue

Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。