Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

website document optimization #1314

Merged
merged 9 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .dumi/theme/builtins/SourceCode/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ const MARKUP_REGEX = {
wechat: /[\n]*?#if ALIPAY[\s\S]*?#endif[\n]*?/g, // 微信平台时,需要去掉支付宝标记的内容
};

const COMMENTS_MARKUP_REGEX = {
if: /#comments\s+if/g,
endif: /#comments\s+endif/g,
};

/**
* define DSL which can be highlighted as similar language
*/
Expand Down Expand Up @@ -55,8 +60,12 @@ const SourceCode: FC<ISourceCodeProps> = (props) => {

// 去掉所有的 #if ALIPAY, #endif 等标记
result = result.replace(MARKUP_REGEX.all, '');

// 如果comments if 或 comments endif 需要处理一下
result = result.replace(COMMENTS_MARKUP_REGEX.if, '#if');
result = result.replace(COMMENTS_MARKUP_REGEX.endif, '#endif');
return result;
}, [pChildren, platform, MARKUP_REGEX]);
}, [pChildren, platform, MARKUP_REGEX, COMMENTS_MARKUP_REGEX]);

const timer = useRef<number>();
const [isCopied, setIsCopied] = useState(false);
Expand Down
20 changes: 10 additions & 10 deletions demo/pages/AutoResize/index.axml
Original file line number Diff line number Diff line change
Expand Up @@ -3,66 +3,66 @@
<ant-container title="基本用法">
<ant-container title="中文">
<ant-auto-resize text="页面遇到一些小问题" minFontSize="24" maxFontSize="60">
<view style="background-color: #1677ff; color: #fff; height: 60rpx;">页面遇到一些小问题</view>
<view class="card" style="height: 60rpx;">页面遇到一些小问题</view>
</ant-auto-resize>
</ant-container>
<ant-container title="英文">
<ant-auto-resize text="The page is experiencing some minor issues" minFontSize="24" maxFontSize="60">
<view style="background-color: #1677ff; color: #fff; height: 60rpx;">
<view class="card" style="height: 60rpx;">
The page is experiencing some minor issues
</view>
</ant-auto-resize>
</ant-container>
<ant-container title="英文-ratio">
<ant-auto-resize text="The page is experiencing some minor issues" ratio="{{ 4 }}" minFontSize="24" maxFontSize="60">
<view style="background-color: #1677ff; color: #fff; height: 60rpx;">
<view class="card" style="height: 60rpx;">
The page is experiencing some minor issues
</view>
</ant-auto-resize>
</ant-container>
<ant-container title="日文">
<ant-auto-resize text="ページにいくつかの小さな問題が発生しています" minFontSize="24" maxFontSize="60">
<view style="background-color: #1677ff; color: #fff; height: 60rpx;">
<view class="card" style="height: 60rpx;">
ページにいくつかの小さな問題が発生しています
</view>
</ant-auto-resize>
</ant-container>
<ant-container title="韩文">
<ant-auto-resize text="페이지에 작은 문제가 발생했습니다" minFontSize="24" maxFontSize="60">
<view style="background-color: #1677ff; color: #fff; height: 60rpx;">페이지에 작은 문제가 발생했습니다</view>
<view class="card" style="height: 60rpx;">페이지에 작은 문제가 발생했습니다</view>
</ant-auto-resize>
</ant-container>
<ant-container title="阿拉伯">
<ant-auto-resize text="تواجه الصفحة بعض المشكلات البسيطة" minFontSize="24" maxFontSize="60">
<view style="background-color: #1677ff; color: #fff; height: 60rpx;">
<view class="card" style="height: 60rpx;">
تواجه الصفحة بعض المشكلات البسيطة
</view>
</ant-auto-resize>
</ant-container>
<ant-container title="西班牙">
<ant-auto-resize text="La página ha encontrado algunos pequeños problemas" minFontSize="24" maxFontSize="60">
<view style="background-color: #1677ff; color: #fff; height: 60rpx;">
<view class="card" style="height: 60rpx;">
La página ha encontrado algunos pequeños problemas
</view>
</ant-auto-resize>
</ant-container>
<ant-container title="俄语">
<ant-auto-resize text="На странице возникли небольшие проблемы" minFontSize="24" maxFontSize="60">
<view style="background-color: #1677ff; color: #fff; height: 60rpx;">
<view class="card" style="height: 60rpx;">
На странице возникли небольшие проблемы
</view>
</ant-auto-resize>
</ant-container>
<ant-container title="法语">
<ant-auto-resize text="La page rencontre quelques problèmes mineurs" minFontSize="24" maxFontSize="60">
<view style="background-color: #1677ff; color: #fff; height: 60rpx;">
<view class="card" style="height: 60rpx;">
La page rencontre quelques problèmes mineurs
</view>
</ant-auto-resize>
</ant-container>
<ant-container title="德语">
<ant-auto-resize text="Auf der Seite treten einige kleinere Probleme auf" minFontSize="24" maxFontSize="60">
<view style="background-color: #1677ff; color: #fff; height: 60rpx;">
<view class="card" style="height: 60rpx;">
Auf der Seite treten einige kleinere Probleme auf
</view>
</ant-auto-resize>
Expand Down
7 changes: 5 additions & 2 deletions demo/pages/AutoResize/index.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
page {
padding-top: 70px;

/// #if WECHAT
box-sizing: border-box;
/// #endif
}

.card {
background-color: var(--color-grey-card);
color: var(--color-text-primary);
}
Loading