Supercharge Markdown with Laravel

Поделиться
HTML-код
  • Опубликовано: 4 авг 2024
  • Extending Markdown in Laravel to render blade components and insert ads, newsletter forms, or links to other articles.
    You can read some of the code here: aaronfrancis.com/2023/renderi....
    ---
    00:00 Extending Markdown
    00:38 Commonmark extensions
    02:08 Dangerous Blade rendering
    05:27 Safe Blade rendering, the first method
    11:19 Adding a safety feature
    13:40 Safe Blade rendering, the second method
    24:37 Adding inline ads with markdown
    29:00 Adding newsletter signups
    ---
  • КиноКино

Комментарии • 49

  • @TravisNorthcutt
    @TravisNorthcutt 7 месяцев назад +6

    I am unreasonably happy that you said "I'm the captain now" for (at least) the second time in a video 👏👏👏

    • @aarondfrancis
      @aarondfrancis  7 месяцев назад

      The second, and not the last 😂

  • @TotalImmort7l
    @TotalImmort7l 4 месяца назад +2

    You might be one of the best and most entertaining teachers on the platform, other than Fireship.

  • @rupadana_
    @rupadana_ 20 дней назад

    what a great explanation dude 👍

  • @BreezyPixels
    @BreezyPixels 7 месяцев назад

    Thanks for amazing video! Was actually dreading trying to figure out how to setup markdown to look nice this week, and now im excited :D

  • @Hyp3r8Sniper
    @Hyp3r8Sniper 7 месяцев назад +7

    Absolutely love how concise and light-hearted your content is, thankyou for valuing our attention!

  • @Cyber_Lanka
    @Cyber_Lanka 4 месяца назад +1

    Hey Aron I just saw you got laid off from PlanetScale. I honestly can't believe it since you and your enthusiasm is one of the biggest reasons for its boom in popularity. Please don't stop making content and I hope you will find a much better place for your next employment. I wish you all the best.

  • @Dero02
    @Dero02 7 месяцев назад +1

    The way you narrate is eerily similar to how I actually talk to myself when coding. 😅

  • @cptive
    @cptive 7 месяцев назад +2

    Great video! Regarding the safe rendering; I also use Markdown + Blade, however instead of doing it the way you did, I decided to use the package by spatie "sheets". Never thought of the Blade code issue, so I decided to check. And sheets seems to handle it for me already! So perhaps a good choice for some people if you don't mind relying on a 3rd party package

    • @aarondfrancis
      @aarondfrancis  7 месяцев назад

      Oh nice! Of course Spatie has a package for it. Does it escape Blade for you?

    • @cptive
      @cptive 7 месяцев назад

      @@aarondfrancis Looks like it! Created a markdown file with some codeblocks with blade directives inside them and it worked fine, lovely video btw. Your approach to these things is always very informative to me 🤍❤️

    • @aarondfrancis
      @aarondfrancis  7 месяцев назад

      @@cptive thank you! ❤️

    • @j_hull
      @j_hull 7 месяцев назад

      @@cptive any chance you have a working example? got sheets all set up and works great - but no joy on the blade directives in code blocks

  • @danfg7215
    @danfg7215 7 месяцев назад +1

    I was caught completely off guard when you switched from dark to light mode without warning. I am now legally blind.

  • @MrNichuya
    @MrNichuya 7 месяцев назад +1

    Hey Aaron, great video as always (because PHP). What patern is your way to go for really large Laravel app?

    • @aarondfrancis
      @aarondfrancis  7 месяцев назад

      I try to stick as close to the framework conventions as possible!

  • @bart_pn
    @bart_pn 7 месяцев назад

    I was wondering, how did you get that little contextual comment in your var dumper that shows the file containing the function call? Big fan of using var dumper in everything I make, but have never made anything in Laravel. Is it something Laravel does with the var dumper component?

    • @aarondfrancis
      @aarondfrancis  7 месяцев назад

      I'm not sure! I think that's a standard laravel thing

  • @angelcruzdev
    @angelcruzdev 7 месяцев назад

    Great video, I think that the first option is more safe to use? Am I wrong? 🤔

  • @andreialdea6072
    @andreialdea6072 7 месяцев назад

    2:05 you write your own = first party,
    the second party is the user ( aka the ones that visit your site or use your library)

    • @aarondfrancis
      @aarondfrancis  7 месяцев назад +1

      I feel like any Commonmark extensions that ship with Commonmark are first party though? Then what are the ones that I write?

    • @cassolmedia
      @cassolmedia 7 месяцев назад +1

      @@aarondfrancis I think first or second party depends on what perspective you're speaking from. if a developer creates an extension then that's first party (to them), but If I use it in my project it's second party(to my project). like, if playstation makes a video game, that's a first party playstation game. but when I make a video game, it's also first party.. just from my perspective...
      or something like that haha

  • @wadday
    @wadday 7 месяцев назад

    i was hoping to see Vue component block along with blade :)

    • @aarondfrancis
      @aarondfrancis  7 месяцев назад

      I guess you could do that with the parse annotation!

  • @medilies
    @medilies 7 месяцев назад

    I'm gonna sue you for surprising me with a light-mode attack at 1:52.
    You have been served.

  • @user-jz8ko6lf9h
    @user-jz8ko6lf9h 7 месяцев назад

    you are great !! but i have a question can i do mobile app with laravel

    • @aarondfrancis
      @aarondfrancis  7 месяцев назад +1

      You could make the backend API but no, not an actual mobile app

  • @igotisekaid
    @igotisekaid 7 месяцев назад

    I like to use Laravel, but i want to make a static website; I know is overkill, but should i really check other options or can i do it no problem with Laravel?

    • @stefanzweifel
      @stefanzweifel 7 месяцев назад

      There is a package called spatie/export, that can convert a Laravel app into a bundle of static HTML sites. I use it myself for my website. Works great.

    • @igotisekaid
      @igotisekaid 7 месяцев назад

      @@stefanzweifel thanx, i will look into it!; what hosting platform do you use if I may ask?

  • @Tuto1902
    @Tuto1902 3 месяца назад

    Is torchlight/torchlight-laravel not supported in Laravel 11? I'm trying to install it with composer but it fails to install. Seems to be looking for illuminate\support ^7.26.0|^8.0
    This happens on a fresh Laravel 11 project.

    • @Tuto1902
      @Tuto1902 3 месяца назад

      My end goal is to use the CommonMark extension to properly highlight code blocks in markdown blog posts.

    • @aarondfrancis
      @aarondfrancis  3 месяца назад +1

      I need to update it! I'll get around to that this week. Sorry for the wait

    • @Tuto1902
      @Tuto1902 3 месяца назад

      @@aarondfrancis Thanks a bunch! In the meantime I'm using the Spatie Markdown plugin which has yielded great results so far. I'm actually going to run a short livestream tomorrow night to show others how to use it. Come hang if you have the time ruclips.net/user/liveFdJ4Mg5SrvE?feature=share

  • @lalit3969
    @lalit3969 7 месяцев назад

    # Summary
    This video discusses how to extend Markdown in Laravel to enhance its functionality. Aaron Francis demonstrates adding syntax highlighting and Blade component rendering to Markdown.
    # Highlights
    - 💡 The author extends Markdown to customize its rendering process and achieve the desired appearance for their website.
    - 💡 They use the Graham Campbell Markdown package, which is a Laravel adapter for the League's CommonMark package.
    - 💡 The author adds the Torchlight extension for syntax highlighting and showcases its capabilities.
    - 💡 They explain the issues with running Blade over Markdown-generated HTML and propose safer alternatives.
    - 💡 The author demonstrates two approaches: removing code blocks, running Blade, and adding them back, or running Blade over the entire document and reinserting the code blocks.
    - 💡 They provide code examples and explain how to enable and disable Blade parsing based on the source of the Markdown content.
    - 💡 The author concludes by discussing the pros and cons of each approach and encourages careful consideration when implementing these extensions.

  • @illegalsmirf
    @illegalsmirf 7 месяцев назад

    Is markdown a replacement for HTML and XML? Why are so many different markdown languages needed?

    • @aarondfrancis
      @aarondfrancis  7 месяцев назад +2

      Markdown is a nice way to write content. It's not a replacement for anything, you can use it if you like it though

  • @BrentMalice
    @BrentMalice 4 месяца назад

    subd cuz of planetscale videos. tell me wat to do now using their competitor and deal

  • @aminathahmed5366
    @aminathahmed5366 3 месяца назад

    how did you made the twitter card embed so nicely like that?

    • @aarondfrancis
      @aarondfrancis  3 месяца назад

      That's a custom blade component!

    • @aminathahmed5366
      @aminathahmed5366 3 месяца назад

      ​​@@aarondfrancis I would like that component to have in my projects, could you share please 🫡

  • @SouravRakshit_srv
    @SouravRakshit_srv 3 месяца назад

    who is the second party 🤣

  • @Ikxi
    @Ikxi 2 месяца назад

    yea i dont understand anything lol