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

Django Snippets Roadmap - all thoughts welcome #210

Open
chriswedgwood opened this issue Jan 30, 2021 · 17 comments
Open

Django Snippets Roadmap - all thoughts welcome #210

chriswedgwood opened this issue Jan 30, 2021 · 17 comments

Comments

@chriswedgwood
Copy link
Collaborator

I would like to canvas opinion for those interested in the the djangosnippets.org project as to how you envision the future of this project. What are its aims and ideals? Could the Django software foundation give me some direction here?

The things I'm thinking/questions off the top of my head:

We should aim to always be on the latest Django Version

Could DjangoSnippets be used as a stepping stone to getting people contributing to the Django project itself? The barrier to entry can be a lot lower and if mistakes are made the risks are quite low. One of my first merges to master took the site down for a week and it was not the end of the world? I see a lot of emails on the Django mailing list asking how people can start contributing. Maybe we can point the less experienced developers here?

Can DjangoSnippets be turned into a simple gold standard application for newcomers to model? If so what are the areas we should address and tidy up?

Static assets. Should we modernise the current pipeline?

Should we incorporate some frontend frameworks as demos?

What do we want out of our api?

Should we do more with social media to raise our profile?

Any thoughts welcome :)

@carltongibson
Copy link
Member

Hey @chriswedgwood -- thanks for this! It's something I've been thinking about for a while.

More or less, I'd like us to have django snippets as a nice example of a smallish Django app. It would be nice then if folks also could use it for snippets 😀

So...

  • I'd keep it about the scope it is.
  • I'd ask contributions to keep it up to date.
  • I'd like to use it as a source for examples when writing about Django, so if I could create a collection, and then embed those in my blog (say) that would be cool.

A basic API would be handy, and yes, some examples of how to integrate with front ends would be a real resource.

Those are my initial thoughts.

And whilst I'm here, a big thanks for your efforts over the last year here! 🏅

@rajpratyush
Copy link

Hi
@carltongibson and @chriswedgwood I would like to contribute to this if it is open

@smithdc1
Copy link
Member

smithdc1 commented Feb 1, 2021

Just to add to the sharing / embedding point above.

There's a fair amount of Django snippets which get shared on Twitter, is there anything we could do here? See an example from @adamchainz

https://twitter.com/AdamChainz/status/1352196191665197056?s=19

@adamchainz
Copy link
Sponsor Member

When I post a snippet on twitter it's an image, but copied out of the relevant blog post. Indexing code from blog posts on django snippets could be a neat idea.

@rajpratyush
Copy link

rajpratyush commented Feb 2, 2021

actually I was not able to understand fully on this. do you mean that to create django code snippets from blog posts or a list of blog posts where django code snippets are there so that people can visit those pages and try to understand it. @adamchainz

@adamchainz
Copy link
Sponsor Member

I meant that snippets from blog posts could be copied into django snippets with a link back to the source post which should fully explain the code.

@rajpratyush
Copy link

rajpratyush commented Feb 2, 2021

sure. @adamchainz I got it now If this issue is open for work I would like to work on it

@chriswedgwood
Copy link
Collaborator Author

Good stuff here. Thanks all. I do like the idea of incentivising bloggers to add a snippet and we will promote their blog.
@carltongibson do you know who owns the djangosnippets account on twitter?It's been quiet since 2014. I would like to start using it and try drive some traffic to the site.

@rajpratyush
Copy link

@adamchainz Do guide me on how to proceed on this issue

@carltongibson
Copy link
Member

Just cutting back to this, lots of people use carbon to post images of source code https://carbon.now.shbut that doesn't give a copy-able source code — it's literally an image. A link back to a real snippet would make those images more useful. (So, something there...)

@jefftriplett
Copy link
Sponsor Member

@carltongibson jinx

@chriswedgwood Thank you for maintaining Django Snippets and keeping the lights on.

I primarily use carbon.now.sh and gists because it makes snippets pretty and visible for Twitter and Slack. Gists because people are on GitHub.

If there was support for one or both of those, that might be nice. Especially better social media support (like carbon.now.sh does or maybe there is an easy way to get carbon.now.sh support for social media images through the meta tags.)

Short-term, I have several gists I can bring over to Django Snippets.

@carltongibson
Copy link
Member

@jefftriplett:

...support for social media images through the meta tags

I was just thinking about this. Looking at the Twitter docs for "Cards" I think we'd need to Post to Twitter function to upload the generated image, since it says the Card display is only triggered when you expand the tweet. (We already have twitter log-in so...)

(Possibly a separate issue if we're to pursue... — can we generate an image? — probably right. 😀)

@jefftriplett
Copy link
Sponsor Member

@carltongibson I haven't had enough coffee, but I don't think you need the post to Twitter, but it could work that way.

Specifically, I'm proposing we had Open Graph / Twitter Card meta data from: https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/summary-card-with-large-image

<meta name="twitter:description" content="Django Snippet Description here but chop it off after a paragraph or x-charcters">
<meta name="twitter:image" content="https://url/to/snippet/image">

But yes, this would require adding image support it might be possible to pass the snippet code off to Carbon Now or a like service to generate that image for us. (that's how the service used to work at least so it's probably still in their API)

@carltongibson
Copy link
Member

@jefftriplett — You could well be right — I was hoping that was the solution (but there was some comment in the docs I linked that made me doubt) — Anyhow... one approach or other should work right? — and that would be cool!

@chriswedgwood
Copy link
Collaborator Author

@carltongibson @jefftriplett I have questions 🤔
I'm trying to get my head around the story that would support gists, twitter summary cards and carbon.now.sh.

  1. User logs in(twitter/github) should we keep bitbucket?
  2. Add Snippet
  3. On save we create a carbon.now.sh image which we store.
  4. DetailView of snippet will be carbon.now.sh but user can click "copy to clipboard/view raw" to get code?
  5. In Detailview option to post it to gist?
  6. In Detailview option to post to twitter as a card with embedded carbon.now.sh?
  7. If user wants both options they will need to login with twitter and github?

Am in the right ballpark here?

@chriswedgwood
Copy link
Collaborator Author

chriswedgwood commented Mar 25, 2021

Or is it:

Our form takes the gist js embed as input?

Where does Pygments fit in all of this?

@carltongibson
Copy link
Member

@chriswedgwood — we should probably have a new ticket — derailing the Roadmap discussion — but 😀 — Ideally...

  • I'd share the django snippets (detail view) URL on twitter.
  • I could type my tweet.
  • If would display a nice render of the code.
  • But the key is that the link goes back to DS, where I can interact and copy the code.

For the image bit:

  • Not sure best way to generate it. Carbon is just what folks are using from this POV. Can we leverage it? Or do we do something with PIL? (It doesn't need to have every theme option and such of Carbon, if we do use PIL)
  • Not sure if we need to post the image to twitter, or can just use the OG tags. (I'd try the 2nd first, as it's clearly easier).

If I could use the same for blog posts and such — image, plus link back to editable snippet — that would cool. 🤔

I need to have a potter around Carbon to see what's possible there.

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

No branches or pull requests

6 participants