Skip to content
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

BBcode venue #368

Closed
wants to merge 6 commits into from
Closed

BBcode venue #368

wants to merge 6 commits into from

Conversation

mcanouil
Copy link

@mcanouil mcanouil commented Mar 17, 2021

As discussed in #350, here is the PR to add BBcode support (mostly for myself, I guess)

(reprex(c("#' Hello world", "## comment", "1:5"), venue = "bb"))
#> i Rendering reprex...
#> v Reprex output is on the clipboard.
#> [1] "[code=php]"                                          
#> [2] "c(\"#' Hello world\", \"## comment\", \"1:5\")"      
#> [3] "#> [1] \"#' Hello world\" \"## comment\"     \"1:5\""
#> [4] "[/code]"                                             

Currently, the BBcode output will look like this:

Hello world
[code=php]
## comment
1:5
#> [1] 1 2 3 4 5
[/code]

image

This PR only translates markdown R code chunk and markdown image tags to BBcode.

Edit: I'll add other common tags such as bold/italics.

@mcanouil mcanouil changed the title Bbcode venue BBcode venue Mar 17, 2021
@mcanouil
Copy link
Author

I don't think there is need to add other BBcode tags for a reprex (list, url for example).
If those translations are not needed, I think this PR is "complete".

(reprex(
  input = c(
    "#' Hello world",
    "## comment",
    "1:5",
    "#' Next is _italic_ or **bold** or even __*bold italic*__",
    "plot(1:3)"
  ), 
  venue = "bb"
))
#> i Rendering reprex...
#> v Reprex output is on the clipboard.
#>  [1] "Hello world"                                                           
#>  [2] ""                                                                      
#>  [3] "[code=php]"                                                            
#>  [4] "## comment"                                                            
#>  [5] "1:5"                                                                   
#>  [6] "#> [1] 1 2 3 4 5"                                                      
#>  [7] "[/code]"                                                               
#>  [8] ""                                                                      
#>  [9] "Next is [i]italic[/i] or [b]bold[/b] or even [i][b]bold italic[/b][/i]"
#> [10] ""                                                                      
#> [11] "[code=php]"                                                            
#> [12] "plot(1:3)"                                                             
#> [13] "[/code]"                                                               
#> [14] ""                                                                      
#> [15] "[img]https://i.imgur.com/6dmuUEo.png[/img]"  

@mcanouil mcanouil closed this Jul 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant