Notnotmike

joined 2 years ago
[–] Notnotmike@beehaw.org 0 points 2 years ago* (last edited 2 years ago)

Just want to plug markdown as a phenomenal resource. You can use it to write documentation both online and offline, and with pandoc you can even use it to create beautiful PDF documents from your computer. Here's some places I use markdown daily, some additional resources, and tips

  • GitHub parses markdown files from their web UI by default
  • Obsidian uses markdown for their note taking application
  • Pandoc can convert Markdown files to other formats including PDF
  • Because it's plaintext, there are fewer formatting errors when moving between applications and you don't even need an application to read them
  • Plaintext also means documents can be easily tracked via source control
  • Lemmy and Reddit both use Markdown
  • Discord uses a variation of Markdown
 

I'm experienced with React and was just trying out a small Svelte to-do list to get my feet wet with Svelte and see if it's something I'd like to suggest we try out at work.

However, there's one thing I wanted to clarify that wasn't immediately obvious from the documentation (and to just kickstart some discussion since this community is a little quiet).

In React, if I have a large file doing a good amount of logic, like in the to-list example where I have add logic, remove logic, and toggle logic, all of which can be complex in their own ways if you improve them enough, I am able to extract the logic out into it's own file by creating a custom hook. Like so

const useTodoList = () => {
  const [list, setList] = useState([]);

  const addItem = (taskName) => {
    // task creation logic
    setList(l => [...l, newTask]);
  }

  // logic for removeItem and toggleItem

  return { list, addItem, removeItem, toggleItem };
}

Then, I can bring that into my component file by simply doing const { ... } = useTodoList(); and everything should just work. What would the equivalent be in Svelte? It sounds like I would want to leverage the store concept, but that feels odd to me. I go from having pretty simple logic to having to add additional libraries to my logic. It's a lot of overhead for what should really be a pretty straightforward refactor in React.

Any insight you guys can give would be great! Additionally, I'd love to be able to move the style as well, but so far haven't found anything that would be suitable for that quite yet. Svelte seems pretty set on having one large file whenever possible.

 

Not talking long-form content, but more short-form, like GIFs and sub-2 minute MP4s. Currently, I don't believe Lemmy supports uploading of video content, but some of my favorite Reddit posts of all time are shorter videos that I would love to bring over to the Fediverse (exhibit A)

So, are hosts like Imgur or Giphy still appreciated here, or is there some open source or federated alternative that I should be giving a shot?