First release
This commit is contained in:
parent
cfe5711e1c
commit
9461041e2e
|
@ -0,0 +1,21 @@
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2022 Jens M Gleditsch
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
|
@ -1,9 +1,9 @@
|
||||||
{
|
{
|
||||||
"id": "Clipper Catalog",
|
"id": "clipper-catalog",
|
||||||
"name": "Clipper Catalog",
|
"name": "Clipper Catalog",
|
||||||
"version": "0.10.1",
|
"version": "1.0.0",
|
||||||
"minAppVersion": "0.15.0",
|
"minAppVersion": "0.15.0",
|
||||||
"description": "This provides any Obsidian vault with a catalog of all the clippings gathered with a common source property.",
|
"description": "A catalog view of all the clippings gathered with a common source property.",
|
||||||
"author": "Obsidian",
|
"author": "Obsidian",
|
||||||
"authorUrl": "https://github.com/soundslikeinfo",
|
"authorUrl": "https://github.com/soundslikeinfo",
|
||||||
"fundingUrl": {
|
"fundingUrl": {
|
||||||
|
|
|
@ -95,14 +95,12 @@ const ClipperCatalog: React.FC<ClipperCatalogProps> = ({ app, plugin }) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadArticles = useCallback(async () => {
|
const loadArticles = useCallback(async () => {
|
||||||
console.log("Starting to load articles...");
|
|
||||||
setIsRefreshing(true);
|
setIsRefreshing(true);
|
||||||
setError(null);
|
setError(null);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const articleFiles: Article[] = [];
|
const articleFiles: Article[] = [];
|
||||||
const files = app.vault.getMarkdownFiles();
|
const files = app.vault.getMarkdownFiles();
|
||||||
console.log(`Found ${files.length} markdown files`);
|
|
||||||
|
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
try {
|
try {
|
||||||
|
@ -120,7 +118,6 @@ const ClipperCatalog: React.FC<ClipperCatalogProps> = ({ app, plugin }) => {
|
||||||
const sourceMatch = frontmatter.match(sourcePropertyRegex);
|
const sourceMatch = frontmatter.match(sourcePropertyRegex);
|
||||||
|
|
||||||
if (sourceMatch) {
|
if (sourceMatch) {
|
||||||
console.log(`Processing file: ${file.path}`);
|
|
||||||
const content = await app.vault.read(file);
|
const content = await app.vault.read(file);
|
||||||
const title = file.basename;
|
const title = file.basename;
|
||||||
|
|
||||||
|
@ -154,10 +151,8 @@ const ClipperCatalog: React.FC<ClipperCatalogProps> = ({ app, plugin }) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(`Processed ${articleFiles.length} articles`);
|
|
||||||
setArticles(articleFiles);
|
setArticles(articleFiles);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error loading articles:", error);
|
|
||||||
setError("Failed to load articles");
|
setError("Failed to load articles");
|
||||||
} finally {
|
} finally {
|
||||||
setIsRefreshing(false);
|
setIsRefreshing(false);
|
||||||
|
|
Loading…
Reference in New Issue