speedata / publisher

speedata Publisher - a professional database Publishing system
https://www.speedata.de/
GNU Affero General Public License v3.0
292 stars 36 forks source link

color for `showhypherlinks` #416

Closed pr-apes closed 1 year ago

pr-apes commented 2 years ago

@pgundlach,

in order to avoid the default black color in links, I think this could be useful:

--- ../old-spp/sw/lua/publisher.lua 2022-08-25 14:39:43.000000000 +0200
+++ sw/lua/publisher.lua    2022-08-26 11:18:08.128250600 +0200
@@ -6804,7 +6806,7 @@
     local pageobjnum = pdf.getpageref(pagenumber)
     local border = "/Border[0 0 0]"
     if options.showhyperlinks then
-        border = ""
+        border = "/C [0 .6 0]"
     end
     local str = string.format("/Subtype/Link%s/A<</Type/Action/S/GoTo/D [ %d 0 R /Fit ] >>",border,pageobjnum)
     hyperlinks[#hyperlinks + 1] = str
@@ -6828,7 +6830,7 @@
 function hlurl(href)
     local border = "/Border[0 0 0]"
     if options.showhyperlinks then
-        border = ""
+        border = "/C [0 .6 0]"
     end
     href = urlencode(href)
     href = escape_pdfstring(href)

Rationale: avoiding the default black color helps to realize that the link border is not printable (only an interactive feature).

BTW, could I have write access to this repository? Otherwise, instead of sending PRs, I have to send snippets such as the previous one.

Many thanks for your help.

pgundlach commented 1 year ago

Not sure if I'd like to change the default. This should be configurable.

BTW, could I have write access to this repository? Otherwise, instead of sending PRs, I have to send snippets such as the previous one.

I'd prefer pull requests or patches. This repository is only a mirror of the main speedata Publisher's repository.

pr-apes commented 1 year ago

Not sure if I'd like to change the default. This should be configurable.

Could we have this as a first step to make it configurable.

I have to study how to add that before.

But having a default other than black would be interesting (to avoid the link frame taken as a printed matter.

pr-apes commented 1 year ago

BTW, could I have write access to this repository? Otherwise, instead of sending PRs, I have to send snippets such as the previous one.

I'd prefer pull requests or patches. This repository is only a mirror of the main speedata Publisher's repository.

I only want the writing access to avoid the problem of sending patches: they are both more work for you and me.

Just to be clear, I don't want writing access to commit directly to this repository [that would be crazy]

I have just sent #419 [a minor typo]. I think it would be easier that you could review and approve the pull request that you'd have to rewrite it to a new commit.

pgundlach commented 1 year ago

I have just sent #419 [a minor typo]. I think it would be easier that you could review and approve the pull request that you'd have to rewrite it to a new commit.

I know it is more work for both of us, but I don't really see a viable alternative for now.

pgundlach commented 1 year ago

See the commit 3f3351d9c06109883159927c2433e2265b04924c for an example that a) allows setting the values while keeping the default and b) the necessary changes to commands.xml from which the schema and the documentation is generated.

I really want to keep the defaults if possible so that the users are not surprised when updating the software.

pr-apes commented 1 year ago

See the commit https://github.com/speedata/publisher/commit/3f3351d9c06109883159927c2433e2265b04924c for an example that a) allows setting the values while keeping the default and b) the necessary changes to commands.xml from which the schema and the documentation is generated.

Many thanks for the commit and your explanation, @pgundlach.

BTW, I'm fine with the way of specifying colors for hyperlinksbordercolor.

But if you allow me a comment, I'm afraid that it is unique and diverging from the explanation about color settings.

I really want to keep the defaults if possible so that the users are not surprised when updating the software.

This is perfectly fine and it totally makes sense.

pgundlach commented 1 year ago

But if you allow me a comment, I'm afraid that it is unique and diverging from the explanation about color settings.

You are right, this should be fixed.

I was afraid that this would be a non-trivial thing to program, but it should be done correctly to comply with the rest of the color definition.

pr-apes commented 1 year ago

Great!