Skip to content

Declare deprecated aliases #521

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions scribble-lib/scribble/private/manual-form.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"manual-vars.rkt"
"manual-scheme.rkt"
"manual-bind.rkt"
racket/deprecation
racket/list
(for-syntax racket/base
syntax/parse
Expand All @@ -22,12 +23,17 @@
specsubform/inline
defsubidform defsubform defsubform*
racketgrammar racketgrammar*
(rename-out [racketgrammar schemegrammar]
[racketgrammar* schemegrammar*])
schemegrammar
schemegrammar*
var svar
(for-syntax kind-kw id-kw link-target?-kw
literals-kw subs-kw contracts-kw))


(define-deprecated-alias schemegrammar racketgrammar)
(define-deprecated-alias schemegrammar* racketgrammar*)


(begin-for-syntax
(define-splicing-syntax-class kind-kw
#:description "#:kind keyword"
Expand Down
60 changes: 40 additions & 20 deletions scribble-lib/scribble/private/manual-scheme.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"manual-utils.rkt" ;; used via datum->syntax
"on-demand.rkt"
(for-syntax racket/base)
(for-label racket/base))
(for-label racket/base)
racket/deprecation)

(provide racketblock RACKETBLOCK racketblock/form
racketblock0 RACKETBLOCK0 racketblock0/form
Expand All @@ -24,25 +25,44 @@
racketmodname
racketmodlink indexed-racket
racketlink

(rename-out [racketblock schemeblock]
[RACKETBLOCK SCHEMEBLOCK]
[racketblock/form schemeblock/form]
[racketblock0 schemeblock0]
[RACKETBLOCK0 SCHEMEBLOCK0]
[racketblock0/form schemeblock0/form]
[racketblockelem schemeblockelem]
[racketinput schemeinput]
[racketmod schememod]
[racket scheme]
[RACKET SCHEME]
[racket/form scheme/form]
[racketresult schemeresult]
[racketid schemeid]
[racketmodname schememodname]
[racketmodlink schememodlink]
[indexed-racket indexed-scheme]
[racketlink schemelink]))
schemeblock
SCHEMEBLOCK
schemeblock/form
schemeblock0
SCHEMEBLOCK0
schemeblock0/form
schemeblockelem
schemeinput
schememod
scheme
SCHEME
scheme/form
schemeresult
schemeid
schememodname
schememodlink
indexed-scheme)


(define-deprecated-alias schemeblock racketblock)
(define-deprecated-alias SCHEMEBLOCK RACKETBLOCK)
(define-deprecated-alias schemeblock/form racketblock/form)
(define-deprecated-alias schemeblock0 racketblock0)
(define-deprecated-alias SCHEMEBLOCK0 RACKETBLOCK0)
(define-deprecated-alias schemeblock0/form racketblock0/form)
(define-deprecated-alias schemeblockelem racketblockelem)
(define-deprecated-alias schemeinput racketinput)
(define-deprecated-alias schememod racketmod)
(define-deprecated-alias scheme racket)
(define-deprecated-alias SCHEME RACKET)
(define-deprecated-alias scheme/form racket/form)
(define-deprecated-alias schemeresult racketresult)
(define-deprecated-alias schemeid racketid)
(define-deprecated-alias schememodname racketmodname)
(define-deprecated-alias schememodlink racketmodlink)
(define-deprecated-alias indexed-scheme indexed-racket)
(define-deprecated-alias schemelink racketlink)


(define-code racketblock0 to-paragraph)
(define-code racketblock to-block-paragraph)
Expand Down
22 changes: 12 additions & 10 deletions scribble-lib/scribble/private/manual-style.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,28 @@
"manual-utils.rkt"
"on-demand.rkt"
"manual-sprop.rkt"
racket/deprecation
racket/list
racket/contract/base
racket/string)

(provide (rename-out [hyperlink link])
(rename-out [other-doc other-manual])
(rename-out [centered centerline])
(provide link
other-manual
centerline
image
(rename-out [image image/plain])
image/plain
itemize
aux-elem
code-inset)
(provide/contract [filebox (((or/c core:element? string?)) () #:rest (listof pre-flow?) . ->* . block?)])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arrow-contract-with-rest-to-arrow-contract-with-ellipses: This ->* contract can be rewritten using -> with ellipses.

Suggested change
[filebox (-> (or/c core:element? string?) pre-flow? ... block?)]))
Debugging details
Textual replacement
(line-replacement
  #:new-lines
    '#("          [filebox (-> (or/c core:element? string?) pre-flow? ... block?)]))")
  #:original-lines
    '#("          [filebox (((or/c core:element? string?)) () #:rest (listof pre-flow?) . ->* . block?)]))")
  #:start-line 27)
Syntactic replacement
(syntax-replacement
  #:introduction-scope #<procedure:...and/syntax-local.rkt:148:2>
  #:new-syntax
    #<syntax:/home/runner/.local/share/racket/8.17.0.6/pkgs/resyntax/default-recommendations/contract-shortcuts.rkt:58:2 (-> (or/c core:element? string?) pre-flow? ... block?)>
  #:original-syntax
    #<syntax:scribble-lib/scribble/private/manual-style.rkt:27:19 (->* ((or/c core:element? string?)) () #:rest (listof pre-flow?) block?)>
  #:source
    (file-source
     #<path:/home/runner/work/scribble/scribble/scribble-lib/scribble/private/manual-style.rkt>))


(define-deprecated-alias link hyperlink)
(define-deprecated-alias other-manual other-doc)
(define-deprecated-alias centerline centered)
(define-deprecated-alias image/plain image)


(define styling-f/c
(() () #:rest (listof pre-content?) . ->* . element?))
(define-syntax-rule (provide-styling id ...)
Expand Down Expand Up @@ -203,12 +211,6 @@
(make-v+u-link
(nonbreaking (racketresultfont "#<undefined>"))))

(define (link url
#:underline? [underline? #t]
#:style [style (if underline? #f "plainlink")]
. str)
(apply hyperlink url #:style (if style (make-style style null) plain) str))

(define (math . s)
(define c (decode-content s))
(make-element
Expand Down
28 changes: 19 additions & 9 deletions scribble-lib/scribble/struct.rkt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#lang racket/base
(require (for-syntax racket/base)
racket/contract/base
racket/deprecation
racket/provide-syntax
racket/struct-info
(rename-in (except-in "core.rkt" target-url struct:target-url target-url? target-url-addr)
Expand Down Expand Up @@ -56,23 +57,32 @@
[(_ [id (field-id ...)]...)
#'(combine-out (struct*-out [id (field-id ...)]) ...)]))


(define-deprecated-alias part-flow part-blocks)
(define-deprecated-alias styled-paragraph? paragraph?)
(define-deprecated-alias styled-paragraph-style paragraph-style)
(define-deprecated-alias styled-itemization? itemization?)
(define-deprecated-alias styled-itemization-style itemization-style)
(define-deprecated-alias element->string content->string)


(provide (struct-out collect-info)
(struct-out resolve-info)
tag? block?

make-flow flow? flow-paragraphs

(except-out (compat-out part) part-title-content)
(rename-out [part-blocks part-flow]
[part-title-content/compat part-title-content])
part-flow
(rename-out [part-title-content/compat part-title-content])
make-versioned-part versioned-part?
make-unnumbered-part unnumbered-part?

(except-out (compat-out paragraph) paragraph-content)
(rename-out [paragraph-content/compat paragraph-content])
make-styled-paragraph
(rename-out [paragraph? styled-paragraph?]
[paragraph-style styled-paragraph-style])
styled-paragraph?
styled-paragraph-style
make-omitable-paragraph omitable-paragraph?

(compat-out table)
Expand All @@ -82,9 +92,9 @@
(struct-out delayed-block)

(compat-out itemization)
(rename-out [itemization-blockss itemization-flows]
[itemization? styled-itemization?]
[itemization-style styled-itemization-style])
styled-itemization?
styled-itemization-style
(rename-out [itemization-blockss itemization-flows])
make-styled-itemization

make-blockquote
Expand Down Expand Up @@ -127,8 +137,8 @@
; generate-tag tag-key current-tag-prefixes add-current-tag-prefix

content->string
(rename-out [content->string element->string]
[content-width element-width])
element->string
(rename-out [content-width element-width])
; strip-aux

block-width
Expand Down