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

New documentation draft: #1069

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

New documentation draft: #1069

wants to merge 14 commits into from

Conversation

xsawyerx
Copy link
Member

@xsawyerx xsawyerx commented Dec 9, 2015

Docs are hard. We currently have the Introduction, the Tutorial,
the Manual, and the Cookbook. It's hard to tell what is documented
where.

The idea was that the Introduction explains things gently,
the Tutorial walks you through writing an application, the Manual
provides the complete coverage, and the Cookbook provides all the
tips, tricks, and hints collected by developers (based heavily
on contributor input).

I think the problem is mainly that we do not have a base-line for
what skills you need in order to understand Dancer and how to use
it. This means we have multiple places to start from, but they
are not clear. Each one tries to cater to multiple different
crowds.

What @mickeyn and I wanted to create was a simple guide that,
assuming you know basic HTTP and Perl, explains the structure of
the Dancer system: the Apps, the routing, the hooks, etc.

Starting from the ground up, this documentation is relatively
thin but is able to not only cover a large and significant portion
of the keywords, it also captures how Dancer works, and how its
structured internally (to an extent).

@xsawyerx
Copy link
Member Author

xsawyerx commented Jan 9, 2016

@PerlDancer, any comments?

@racke
Copy link
Member

racke commented Jan 10, 2016

Not yet, will check in later!

@SysPete
Copy link
Member

SysPete commented Jan 12, 2016

excellent 👍

@SysPete
Copy link
Member

SysPete commented Feb 9, 2016

@racke you promised to have a look at this...

@racke
Copy link
Member

racke commented Feb 11, 2016

Thanks for the reminder, @SysPete. Let's start with the simple things first - I found a small typo: racke@8c58764.

Is there a way to get HTML out of the PODs with my old friend Dist::Zilla?

Simply using Pod::Simple::HTMLBatch won't work with the special POD elements.

@xsawyerx
Copy link
Member Author

@racke++ Thanks for the typo fix. I missed it.

Basically, dzil build and perldoc the POD. Wish it was easier, but it's not that bad, I guess.

@racke
Copy link
Member

racke commented Feb 11, 2016

The problem with perldoc is that it doesn't show any links etc.

@racke
Copy link
Member

racke commented Feb 11, 2016

get
Handles GET methods.

I think this should say "Handles GET method" - we have only one.

@racke
Copy link
Member

racke commented Feb 11, 2016

It had a first glance at it before and will continue to review it. It is definitely well written and a big improvement for any user, especially new users.

@racke
Copy link
Member

racke commented Feb 11, 2016

What about adding some suggestions about common plugins? So many users try to reinvent the wheel for authentication, database access, you name it.

@xsawyerx
Copy link
Member Author

GET methods and GET method are both wrong, IMHO. What I should have written was handles requests using GET method.

Common plugins is a good idea, except the list of recommended modules would be limited. We can also half-endorse. Like, this exists.

Another note to self: would be great to have a synopsis including all the core pieces.

@racke
Copy link
Member

racke commented Feb 16, 2016

This documentation doesn't go into the details about the engines - which is fine, but we should add pointers
from the Engine section so users can go into the details for loggers etc.

@xsawyerx
Copy link
Member Author

What details would you like it to go into?

@racke
Copy link
Member

racke commented Feb 16, 2016

Like an overview on the existing loggers and the configuration options.

@racke
Copy link
Member

racke commented Feb 16, 2016

It would probably be easier to merge this draft and add new issues for the stuff mentioned here :-).

@xsawyerx
Copy link
Member Author

xsawyerx commented Mar 8, 2016

Should we ask on the mailing list for people to review this?

What's hard for me is to answer the question: Is this better than what we had before? To me it feels like it because it's shorter, succinct, and (IMHO) teaches you more than the previous documentation - but I'm not sure what other people think.

@racke
Copy link
Member

racke commented Mar 8, 2016

On 03/08/2016 09:26 AM, Sawyer X wrote:

Should we ask on the mailing list for people to review this?

What's hard for me is to answer the question: Is this better than what we had before?
To me it feels like it because it's shorter, succinct, and (IMHO) teaches you more than the previous documentation - but I'm not sure what other people think.

I'm quite convinced that this is better than before - and it can't hurt to give the people a chance to review it.
I suggest to put in somewhere as HTML so people can browse it easily.

Regards
Racke

Perl and Dancer Development

generation of L<Dancer> and replaces L<Dancer>.

If you are converting a L<Dancer> application to L<Dancer2>, the
L<Dancer2::Manual::Migration> document covers the changes you might
Copy link
Contributor

Choose a reason for hiding this comment

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

"might" sounds a bit vague - consider deleting "might"

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure every app actually needs updating. I don't want to make an assumption about it.

Copy link
Member

Choose a reason for hiding this comment

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

On 04/07/2016 01:36 PM, Sawyer X wrote:

In lib/Dancer2.pm #1069 (comment):

=head1 DESCRIPTION

-Dancer2 is the new generation of L, the lightweight web-framework for
-Perl. Dancer2 is a complete rewrite based on L.
+Dancer2 is a lightweight micro web framework for Perl. It is the new
+generation of L and replaces L.
+
+If you are converting a L application to L, the
+LDancer2::Manual::Migration document covers the changes you might

I'm not sure every app actually needs updating. I don't want to make an assumption about it.

At the very least you need to replace Dancer with Dancer2 :-).

Regards
Racke

Perl and Dancer Development

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right. I'll make that correction.

@jasonblewis
Copy link
Contributor

Maybe something along the lines of:

To convert a L<Dancer> application to L<Dancer2>, it may simply be a matter of changing use Dancer; to use Dancer2;. The +L<Dancer2::Manual::Migration> document covers any other changes you might...

@xsawyerx
Copy link
Member Author

xsawyerx commented Apr 7, 2016

I like that suggestion very much! I'll use that.

@xsawyerx
Copy link
Member Author

xsawyerx commented Apr 7, 2016

Updated.

@xsawyerx
Copy link
Member Author

What isn't discussed here yet is deprecating the existing Manual. This should effectively replace it. We would still keep the deployment doc, the migration doc, and an index of all the DSL. For now we can also keep the tutorial, although that can (and probably should) be split to another distribution.

What says @PerlDancer team?

@racke
Copy link
Member

racke commented May 26, 2016

I find the example code in the tutorial not very enticing, also it may lead people on the wrong path (code on their own instead using DBIC / DPAE). So I'm fine with removing that as well.

Otherwise I agree with the deprecation.

@cromedome
Copy link
Contributor

I agree with @racke.

@xsawyerx
Copy link
Member Author

xsawyerx commented Mar 7, 2017

Okay I want to push this forward. I realized we still have the old documentation in and I keep pointing to these commits as a more readable documentation. What is left on this to just merge it?
(I rebased the branch.)

@cromedome
Copy link
Contributor

cromedome commented Mar 8, 2017

@xsawyerx I am really fond of this rewrite. I am a bit embarrassed to say that I haven't looked at them in a while though, and will take another read through once I finish this release this week. Then, let's please come up with a plan for merging and pushing these out, and deprecating the old Manual 💃 Will that work?

@bigpresh
Copy link
Member

I'd be inclined to say that, if the merge conflicts can be fixed, this ought to be merged, and the doco as it then stands re-reviewed and improved further, using your checklist for inspiration. Even if it's not 100% complete, it looks to be a good improvement.

If I get a chance soon, I'd be happy to sit down and review the doco in detail and see what improvements I can come up with, too.

@bigpresh
Copy link
Member

Right - this one needs addressing - good doco is incredibly important, and the great work done in this PR is sitting unused! I'm of the opinion that, even if there's some improvements still to be made, it's a good improvement, and so we should merge the bloody thing then improve iteratively, otherwise it'll never get in. Thoughts?

@xsawyerx
Copy link
Member Author

I only have two problems: 1. I don't want to merge this and to lose documentation for stuff I listed. 2. I want additional documentation to take the ideas I had in mind when writing this.

I can review this again over the weekend and try to add what's missing - at least the big stuff. What would be great is if it I can get around to write an internal documentation on how to document, like a style guide.

@xsawyerx
Copy link
Member Author

I can rebase this branch as well.

@ambs
Copy link
Member

ambs commented Oct 5, 2017

Please take a decision on this branch. Having it here so much time doesn't do any good. More like bad. Rebase it, and make your list of enhancements a list of issues, so people can pick low hanging fruit.

@sdondley
Copy link
Contributor

sdondley commented Dec 6, 2017

I'd like to pitch and help where I can. I'm totally new to Dancer. However, this can be an asset as I can help point out what might be confusing to a newb. I'm a pretty decent writer.

And I've never used GitHub and git on a serious project so it's a bit disorienting for me right now. So a little patience would be appreciated. Once I get my bearings, I should be able to help quite a bit.

@cromedome
Copy link
Contributor

I agree with @ambs - anything we can do to get this going again and merged would be great. People have a love/hate relationship with the docs it seems, so doing something to make the docs even better would be a welcome improvement!

@sdondley
Copy link
Contributor

Not having any direction, I went ahead and committed some changes last night to Manual.pod, mostly as an exercise for myself to help solidify what I already know about Dancer2 and just to help get a better overall feel for the current quality of the documentation as it currently stands. See #1424 for my pull request. Feel free to incorporate, or not, any of my changes as you see fit.

Before I go too much further, though, I'd like to get a solid commitment that others are still interested in working collaboratively on this task which is now over 2 years old and doesn't show much signs of life. Can we set some kind of arbitrary deadline, like say, the end of January to have this effort wrapped up? And who, exactly, is still actively interested in working on this? Without knowing, I feel a bit left up in the air.

xsawyerx and others added 6 commits January 19, 2022 16:14
Docs are hard. We currently have the Introduction, the Tutorial,
the Manual, and the Cookbook. It's hard to tell what is documented
where.

The idea was that the Introduction explains things gently,
the Tutorial walks you through writing an application, the Manual
provides the complete coverage, and the Cookbook provides all the
tips, tricks, and hints collected by developers (based heavily
on contributor input).

I think the problem is mainly that we do not have a base-line for
what skills you need in order to understand Dancer and how to use
it. This means we have multiple places to start from, but they
are not clear. Each one tries to cater to multiple different
crowds.

What @mickeyn and I wanted to create was a simple guide that,
assuming you know basic HTTP and Perl, explains the structure of
the Dancer system: the Apps, the routing, the hooks, etc.

Starting from the ground up, this documentation is relatively
thin but is able to not only cover a large and significant portion
of the keywords, it also captures how Dancer works, and how its
structured internally (to an extent).
I more strongly worded the section about the dance keyword in "Running
the application" to further discourage people from using it.

In the sessions section, I listed a couple of session engines that are
suitable for production use to help address any questions about what is
or isn't considered production ready.
This is a port of a commit by racke (GH #1329).
@xsawyerx
Copy link
Member Author

xsawyerx commented Jan 20, 2022

@cromedome and I discussed this work and we formed a plan for moving forward on it:

  • Go over the docs and freshen them up a bit
  • Go over the docs again and include all the comments from the discussion in this ticket (I have those listed)
  • Go over the docs again and include all the enhancements we have done since this PR was created (I have those listed)
  • Go over the topics I listed in an earlier comment of mine on this ticket and add them to the documentation
  • Go over the existing Dancer2::Manual double-check everything is covered
  • Replace Dancer2::Manual with this and create an index in Dancer2.pm (see section below)
  • Request feedback from core developers and documentation contributors
  • Request feedback on the mailing list
  • Merge and release!

Additionally, we are thinking of cleaning up the documentation paths:

  • Dancer2.pm will become the index, pointing to all the manual sections
  • Dancer2::Manual will host the new documentation that this PR shows (right now it's in Dancer2.pm but I'll eventually move it to Dancer2::Manual
  • Dancer2::Config should be merged into Dancer2::Manual
  • Dancer2::Tutorial will likely need to be rewritten and renamed to Dancer2::Manual::Tutorial
  • Dancer2::Cookbook will be renamed to Dancer2::Manual::Cookbook
  • Dancer2::Manual::Keywords will be renamed to Dancer2::Manual::Reference (not 100% on this one yet)

* Document all the different engines - what they do, why they exist
* Document where plackup comes from
* Fix wording on methods
* The .dancer file
* Local configuration files
* Defining routes returns a Dancer2::Core::Route object
* The send_as keyword (along with content types)
* Templates can be used anywhere
* The request_data keyword
lib/Dancer2.pm Outdated Show resolved Hide resolved
lib/Dancer2.pm Outdated Show resolved Hide resolved
lib/Dancer2.pm Outdated Show resolved Hide resolved
lib/Dancer2.pm Show resolved Hide resolved
lib/Dancer2.pm Outdated Show resolved Hide resolved
@xsawyerx
Copy link
Member Author

@racke not sure the fixes are good. Feel free to adjust. I couldn't come up with a better way to deal with some of them.

lib/Dancer2.pm Outdated

This will match both F</view/> and F</new/view/here>.

Any capturing done in regular expressionos are available using the
Copy link
Contributor

Choose a reason for hiding this comment

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

s/expressionos/expressions/;

Copy link
Member Author

Choose a reason for hiding this comment

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

I can't find this in the most recent version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants