{"id":13441357,"url":"https://github.com/RimoChan/smoke_of_deceit","last_synced_at":"2025-03-20T11:38:21.881Z","repository":{"id":42194480,"uuid":"469289275","full_name":"RimoChan/smoke_of_deceit","owner":"RimoChan","description":"把代码藏起来！","archived":false,"fork":false,"pushed_at":"2022-04-11T03:19:43.000Z","size":5,"stargazers_count":50,"open_issues_count":1,"forks_count":7,"subscribers_count":3,"default_branch":"slave","last_synced_at":"2024-08-01T03:34:07.897Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RimoChan.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-13T06:27:23.000Z","updated_at":"2024-06-25T19:57:09.000Z","dependencies_parsed_at":"2022-08-12T09:01:18.259Z","dependency_job_id":null,"html_url":"https://github.com/RimoChan/smoke_of_deceit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RimoChan%2Fsmoke_of_deceit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RimoChan%2Fsmoke_of_deceit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RimoChan%2Fsmoke_of_deceit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RimoChan%2Fsmoke_of_deceit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RimoChan","download_url":"https://codeload.github.com/RimoChan/smoke_of_deceit/tar.gz/refs/heads/slave","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221759952,"owners_count":16876323,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T03:01:33.017Z","updated_at":"2024-10-28T01:30:37.530Z","avatar_url":"https://github.com/RimoChan.png","language":null,"funding_links":[],"categories":["HarmonyOS"],"sub_categories":["Windows Manager"],"readme":"# 把代码藏起来！\n\n事情是这样的，前几天，我发现我的Vtuber教程仓库里的Markdown渲染不出来了。\n\n当时我以为是GitHub的bug，但是我发现其他的仓库里Markdown渲染就是正常的。于是我对比了一下，才想起我不知道什么时候往这个仓库里塞了一个奇怪的`.gitattributes`。\n\n它的内容是这样的——\n\n```\n*.* linguist-language=python\n```\n\n也就是说，GitHub在网页上渲染代码时，不仅会根据后缀，也会根据`.gitattributes`的`linguist-language`指示。\n\n这里面显然有一个特例是Markdown，它并不是语义着色，而是把代码编译成HTML……那这样一来，岂不是就可以把代码假装成Markdown，让别人在网页上找不到代码！\n\n\n## 如何操作\n\n\n1. 新建一个`.gitattributes`文件，加上一行`*.* linguist-language=Markdown`，把所有代码都变成Markdown。\n\n2. 在你的普通代码中利用神奇的注释操作，让它恰好同时是一个合法的那个原本的语言的文件和一个空的Markdown文件。\n\n具体可以参考`.gitattributes`和`smoke.py`这两个文件。对了，如果你在网页上直接打开`smoke.py`，应该已经看不到里面的代码了，要点raw按钮才能看到。\n\n\u003csub\u003e(不过我也没想到怎么把开头的`#`去掉……)\u003c/sub\u003e\n\n\n## 用法\n\n没什么用，也许可以骗一骗幼女？\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRimoChan%2Fsmoke_of_deceit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRimoChan%2Fsmoke_of_deceit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRimoChan%2Fsmoke_of_deceit/lists"}