Skip to content

Yukari-App/Core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚙️ Yukari.Core

NuGet Version GitHub last commit GitHub repo size

📖 Overview

Yukari.Core is the central library of contracts and data models for the Yukari ecosystem.

It defines the IComicSource interface and all the necessary templates (Comic, Chapter, ChapterPage, Filter, etc.) that must be implemented by comic plugins/sources.

The main application Yukari (a modern manga, webtoon, and comic book reader for Windows, built on WinUI 3 + .NET) dynamically loads these plugins to search, list, and read content from different websites and services without needing to modify the main code.

Now stable — the Core API is solid and ready for third‑party plugin development.

✍️ How to Create a ComicSource

  • Create a new Class Library project (.NET 10)
  • Install the package:
  <PackageReference Include="Yukari.Core" Version="*" />
  • Decorate your class with [ComicSourceMetadata] and implement IComicSource:
  [ComicSourceMetadata(
      name: "My Source",
      version: "1.0.0+core2.3.0", // Match your Yukari.Core version
      ReleasesPage: "https://github.com/MyName/Yukari.Plugin.MySource/releases",
      logoUrl: null,
      description: "Example comic source"
  )]
  public class MyComicSource : IComicSource
  {
      public IReadOnlyList<Filter> Filters => Array.Empty<Filter>();
      public IReadOnlyDictionary<string, string> Languages =>
          new Dictionary<string, string> { ["en"] = "English" };

      public Task<IReadOnlyList<Comic>> SearchAsync(
          string query,
          IReadOnlyDictionary<string, IReadOnlyList<string>> filters,
          int page = 1,
          CancellationToken ct = default
      )
      {
          // Implement search logic here
          return Task.FromResult<IReadOnlyList<Comic>>(Array.Empty<Comic>());
      }

      // Implement remaining methods: GetTrendingAsync, GetDetailsAsync,
      // GetAllChaptersAsync, GetChapterPagesAsync...

      public ValueTask DisposeAsync() => ValueTask.CompletedTask;
  }

Note: The [ComicSourceMetadata] attribute is required. Yukari reads plugin metadata (name, version, logo, description) directly from the attribute without instantiating the class, so omitting it will cause the plugin to fail to load.

🗒️ Notes

  • The [ComicSourceMetadata] attribute is the only way to declare plugin metadata — Name, Version, LogoUrl and Description are not part of IComicSource
  • Versioning matters — the version field should include the targeted Core version in the format +coreX.Y.Z (e.g., 1.0.0+core2.3.0). Yukari uses this to detect outdated plugins and show an update badge in the settings. Plugins that omit this convention simply won't show the badge
  • Use a single/shared HttpClient instance with proper User-Agent
  • Consider static lazy initialization for Filters and Languages
  • Respect rate limits and implement proper error handling
  • Return empty collections or null instead of throwing when no data is found (when reasonable)
  • All async methods should support CancellationToken
  • XML documentation on public members is highly appreciated
  • If your plugin depends on third-party libraries, merge them into a single .dll using ILRepack.Lib.MSBuild.Task. Make sure to exclude Yukari.Core from the merge — including it would cause type identity conflicts at runtime, since the host already loads its own copy of the assembly
  • The reserved source name "Local" cannot be used as a plugin name — Yukari uses it internally for local comics and will reject any plugin that attempts to register with that name

🤝 Contributing

Contributions are welcome! You can help improve Yukari.Core in several ways:

  • 🐛 Report issues: Found a bug or unexpected behavior? Open an issue describing the problem.
  • Suggest features: Have an idea to make Yukari.Core better? Share it in the issues tab.
  • 🔧 Submit pull requests: Fix bugs, improve code quality, or add new features.

📜 License

This project is licensed under the GPL-3.0. See the LICENSE file for details.

About

The API Contract and Data Models for the Yukari Ecosystem

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages