django / djangosnippets.org

The code that powers djangosnippets.org, it allows users to post and share useful "snippets" of code.

Home Page:https://djangosnippets.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Django Snippets Roadmap - all thoughts welcome

chriswedgwood opened this issue Β· comments

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 :)

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! πŸ…

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

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

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.

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

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.

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

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.

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

Just cutting back to this, lots of people use carbon to post images of source code https://carbon.now.sh β€” but 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...)

@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.

@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. πŸ˜€)

@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)

@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!

@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?

Or is it:

Our form takes the gist js embed as input?

Where does Pygments fit in all of this?

@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.