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

proposal: x/tools/present: add support to mark text as inserted (+) or deleted (~) to the present package #20283

Closed
afh opened this issue May 8, 2017 · 13 comments

Comments

@afh
Copy link

afh commented May 8, 2017

Proposal

Marking text as inserted or deleted (e.g. deleted inserted) to show corrections in a text can be helpful, especially in blog post articles.

I hereby propose to add the following additional text markers to [present.font])https://github.com/golang/tools/blob/master/present/style.go#L40):

  • ~ to denote deleted text, which will render the marked text within the <del>-tag
  • + to denote inserted text, which will render the marked text within the <ins>-tag

See Gerrit Change #42818 for details.

What did you do?

Compile and run the following program:

package main

import (
	"fmt"
	"golang.org/x/tools/present"
)

func main() {
	s := "This is ~deleted~ +inserted+ text."
	fmt.Println(string(present.Style(s)))
}

What did you expect to see?

This is <del>deleted</del> <ins>inserted</ins> text.

What did you see instead?

This is ~deleted~ +inserted+ text.

What version of Go are you using (go version)?

go version go1.8.1 darwin/amd64

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Volumes/Users/afh/Library/Go"
GORACE=""
GOROOT="/opt/homebrew/Cellar/go/1.8.1/libexec"
GOTOOLDIR="/opt/homebrew/Cellar/go/1.8.1/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/h7/hy79lh5922l19t0v8vjrxn_c0000gp/T/go-build335905375=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
@bradfitz bradfitz changed the title Add support to mark text as inserted (+) or deleted (~) to the present package proposal: x/tools/present: add support to mark text as inserted (+) or deleted (~) to the present package May 8, 2017
@gopherbot gopherbot added this to the Proposal milestone May 8, 2017
@rsc
Copy link
Contributor

rsc commented May 15, 2017

/cc @adg @robpike

@robpike
Copy link
Contributor

robpike commented May 16, 2017

I'm pushing back on changes like this, to try to keep present's syntax from becoming intricate and requiring special work to step around when necessary. Is this one worth fighting for? I've never wanted anything like it, but maybe that's just me.

@afh
Copy link
Author

afh commented May 17, 2017

Whether this one is worth fighting for depends on the intent or use of the present package. If it is merely for simple presentations then I do not see the need for this addition. If it is also for blog articles, then it could be useful to denote changes in the text. If it seen as a more generic markup to HTML conversion package, then yes, an addition like this would be worth fighting for.

My idea for these changes was to improve the present package to make it more versatile. As @robpike points out that may not be original idea or current plan for package, and other packages may be more suited to accomplish the task.

@griesemer
Copy link
Contributor

FWIW, I've used present occasionally, and it's just about right for straight-forward slide presentation - it's original goal (see its name). Every once in a while I wanted more, but usually then it's a lot more. In those cases I use a different tool.

It seems to me that for blog posts eventually one will want a lot more and that one should perhaps use a different tool instead.

@afh
Copy link
Author

afh commented May 18, 2017

@griesemer Thanks for your comment. Care to share which tools you used?

@griesemer
Copy link
Contributor

@afh I'm pretty happy with Google Slides for those presentations where I need a bit more flexibility.

@rsc
Copy link
Contributor

rsc commented May 18, 2017

I hesitate to mention this, because we're not ready to do anything about it today or in the near term, but in the longer term it seems like Markdown has won and we should plan to move away from our custom markup to Markdown. So I'd suggest for now treating present syntax as basically frozen.

@adg
Copy link
Contributor

adg commented May 18, 2017 via email

@robpike
Copy link
Contributor

robpike commented May 18, 2017

Markdown would be fine with me if someone else were to do all the conversions. However, a major caveat: we cannot lose the functionality of .play. But it should be easy to preserve it as an extension.

@griesemer
Copy link
Contributor

We're not the only users of present, and I suspect other users may want their presentations to work in the future. I think it's fine to introduce markdown, but the old format should still be accepted (and perhaps internally translated to markdown) by present.

@afh
Copy link
Author

afh commented May 19, 2017

Thank you everyone for your comments, quite insightful.
The .play and .code functionality was what initially attracted me.

What I hear is that if changes to the package are made then

  • present and blog should be based on Markdown
  • functionality to convert the current syntax to Markdown is needed
  • a Markdown extension to support the .play and .code functionality as well

@rsc
Copy link
Contributor

rsc commented Jun 5, 2017

That sounds right. I'm going to close this bug as "move to markdown first".

@rsc rsc closed this as completed Jun 5, 2017
@afh
Copy link
Author

afh commented Jun 6, 2017

👍

@golang golang locked and limited conversation to collaborators Jun 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants