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

Small Pod tweaks. #3

Closed
wants to merge 1 commit into from
Closed

Small Pod tweaks. #3

wants to merge 1 commit into from

Conversation

oalders
Copy link

@oalders oalders commented Jul 22, 2014

This is a bunch of Pod tweaks. I won't be offended if you don't merge. Essentially the main problem I wanted to fix was the gaps in the source view: https://metacpan.org/source/KENTNL/HTTP-Tiny-Mech-1.001000/lib/HTTP/Tiny/Mech.pm

I think that's because of the missing =pod markers. As I was changing that I got a Pod error about encoding, so I added the utf8 encoding, which doesn't appear to break anything.

Then I got an error about =attr not being valid, so I changed that to an =over and =item, which may or may not be in line with the display you were going for. ;)

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 3f75dfd on oalders:pod-tweaks into a1acb70 on kentnl:master.

@kentfredric
Copy link
Member

I'm not sure why you're seeing =attr not being valid. Its intentionally fake POD that Dzil's Pod::Weaver translates to real pod, as seen here:

https://metacpan.org/source/KENTNL/HTTP-Tiny-Mech-1.001000/lib/HTTP/Tiny/Mech.pm#L178

=head1 ATTRIBUTES

=head2 C<mechua>

Similarly, =pod isn't necessary, because Pod::Weaver also injects that: https://metacpan.org/source/KENTNL/HTTP-Tiny-Mech-1.001000/lib/HTTP/Tiny/Mech.pm#L135

=pod

=encoding UTF-8

Pod::Weaver also nukes all the superfluous =cut for me.

And the =encoding line is also added by my Pod::Weaver configuration: https://metacpan.org/source/KENTNL/HTTP-Tiny-Mech-1.001000/lib/HTTP/Tiny/Mech.pm#L137

So it seems to me that you were having some sort of issue looking at the source tree when you should have been looking at the build tree.

The "Gaps" in the source view ( ie: the large amounts of whitespace ) are a configuration option of https://metacpan.org/pod/Pod::Elemental::PerlMunger#replace_with_blank

And this exists in this configuration to keep source line numbers and release line numbers the same.

replace_with_nothing results in massive line number shifts, and replace_with_comment does this:

https://metacpan.org/source/DAGOLDEN/Path-Tiny-0.055/lib/Path/Tiny.pm#L154

#pod =construct path
#pod
#pod     $path = path("foo/bar");
#pod     $path = path("/tmp", "file.txt"); # list
#pod     $path = path(".");                # cwd
#pod     $path = path("~user/file.txt");   # tilde processing
#pod

However, for me I had some intolerable consequence of using the latter too, so I settled on replace_with_blank for the time being. ( I can't remember what the exact reason, I just recall there being one and I subsequently forgot the specifics )

I do however appear to be the sole user of replace_with_blank : http://grep.cpan.me/?q=replace_with_blank

But you could literally alternate between the 3 forms simply changing this one line:

https://metacpan.org/source/KENTNL/HTTP-Tiny-Mech-1.001000/dist.ini#L66

[PodWeaver / @Author::KENTNL/PodWeaver]
replacer = replace_with_blank

@oalders
Copy link
Author

oalders commented Jul 22, 2014

Ah, OK. I was just checking the Pod with Perldoc rather than generating it with dzil. Ignore me in that case. Also, I never considered that the blank lines would be intentional. ;) Thanks for the detailed explanation. I've learned a few things about dzil plugins today.

@oalders oalders closed this Jul 22, 2014
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.

3 participants